CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - max
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - max - List
[
Process-Thread
]
zy1
DL : 0
一.算法介绍: **数据结构: 1.可利用资源向量Available 2.最大需求矩阵Max 3.分配矩阵Allocation 4.需求矩阵Need **功能介绍: 模拟实现Dijkstra的银行家算法以避免死锁的出现.分两部分组成: 第一部分:银行家算法(扫描) 1.如果Request<=Need,则转向2 否则,出错 2.如果Request<=Available,则转向3,否则等待 3.系统试探分配请求的资源给进程 4.系统执行安全性算法 第二部分:安全性算法 1.设置两个向量 (1).工作向量:Work=Available(表示系统可提供给进程继续运行所需要的各类资源数目) (2).Finish:表示系统是否有足够资源分配给进程(True:有 False:没有).初始化为False 2.若Finish[i]=False&&Need<=Work,则执行3 否则执行4(I为资源类别) 3.进程P获得第i类资源,则顺利执行直至完成!并释放资源: Work=Work+Allocation Finish[i]=true 转2 4. 若所有进程的Finish[i]=true,则表示系统安全 否则,不安全!-one. Algorithm introduced : ** Data Structure : 1. The resources available vector Available 2. The biggest demand matrix Max 3. Allocation distribution matrix 4. Need ** demand matrix function presentations : Simulation of bankers Dijkstra algorithm to avoid the emergence of deadlock. Composed of two parts : Part I : bankers algorithm (scanning) 1. If Requestlt; = Need, has turned two Otherwise, the two errors. If Requestlt; = Available, has turned three, or wait for the three. System testing requested resource allocation process to four. Safety system for the implementation of the second part of algorithm : a security algorithm. Set up two vector (1). Vector work : Work = Available (expressed system available to the continued operation of the process required number of resources of all ki
Date
: 2008-10-13
Size
: 7.7kb
User
:
李琪
[
Process-Thread
]
zy1
DL : 0
一.算法介绍: **数据结构: 1.可利用资源向量Available 2.最大需求矩阵Max 3.分配矩阵Allocation 4.需求矩阵Need **功能介绍: 模拟实现Dijkstra的银行家算法以避免死锁的出现.分两部分组成: 第一部分:银行家算法(扫描) 1.如果Request<=Need,则转向2 否则,出错 2.如果Request<=Available,则转向3,否则等待 3.系统试探分配请求的资源给进程 4.系统执行安全性算法 第二部分:安全性算法 1.设置两个向量 (1).工作向量:Work=Available(表示系统可提供给进程继续运行所需要的各类资源数目) (2).Finish:表示系统是否有足够资源分配给进程(True:有 False:没有).初始化为False 2.若Finish[i]=False&&Need<=Work,则执行3 否则执行4(I为资源类别) 3.进程P获得第i类资源,则顺利执行直至完成!并释放资源: Work=Work+Allocation Finish[i]=true 转2 4. 若所有进程的Finish[i]=true,则表示系统安全 否则,不安全!-one. Algorithm introduced :** Data Structure : 1. The resources available vector Available 2. The biggest demand matrix Max 3. Allocation distribution matrix 4. Need** demand matrix function presentations : Simulation of bankers Dijkstra algorithm to avoid the emergence of deadlock. Composed of two parts : Part I : bankers algorithm (scanning) 1. If Requestlt; = Need, has turned two Otherwise, the two errors. If Requestlt; = Available, has turned three, or wait for the three. System testing requested resource allocation process to four. Safety system for the implementation of the second part of algorithm : a security algorithm. Set up two vector (1). Vector work : Work = Available (expressed system available to the continued operation of the process required number of resources of all ki
Date
: 2025-12-28
Size
: 7kb
User
:
李琪
[
Process-Thread
]
banker
DL : 0
可运行 #define W 10 //最大进程数W=10 #define R 20 //最大资源总数=20 int AVAILABLE[R] //可利用资源向量 int MAX[W][R] //最大需求矩阵 int ALLOCATION[W][R] //分配矩阵 int NEED[W][R] //需求矩阵 int Request[R] //进程请求向量 -Can run#define W 10 // maximum number of processes W = 10#define R 20 // maximum total resources = 20 int AVAILABLE [R] // resources available vector int MAX [W] [R] // maximum demand Matrix int ALLOCATION [W] [R] // assignment matrix int NEED [W] [R] // demand matrix int Request [R] // Process request vector
Date
: 2025-12-28
Size
: 91kb
User
:
toy
[
Process-Thread
]
71151129
DL : 0
A stack-based sequential depth-first decoder that returns Max()
Date
: 2025-12-28
Size
: 20kb
User
:
upk%252402932
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.