文件名称:zy1
介绍说明--下载内容均来自于网络,请自行研究使用
一.算法介绍:
**数据结构:
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
**数据结构:
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
(系统自动生成,下载前可以参看下载内容)
下载文件列表
zy1.doc