-------------资源分配表---------------
Max Allocation Need
P0 7 5 3 0 1 0 7 4 3
P1 3 2 2 3 0 2 0 2 0
P2 9 0 2 3 0 2 6 0 0
P3 2 2 2 2 1 1 0 1 1
P4 4 3 3 0 0 2 4 3 1
Available:2 3 0
P0:Request(1,0,0)
进行资源试分配……
---------资源分配表----------
Allocation Need
P0 1 1 0 6 4 3
P1 3 0 2 0 2 0
P2 3 0 2 6 0 0
P3 2 1 1 0 1 1
P4 0 0 2 4 3 1
Available:1 3 0
安全性检测……
[0]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P0 4 3 2 6 4 3 1 1 0 5 4 2 1
P2 5 4 2 6 0 0 3 0 2 8 4 4 1
P3 8 4 4 0 1 1 2 1 1 10 5 5 1
P4 10 5 5 4 3 1 0 0 2 10 5 7 1
[1]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P0 4 3 2 6 4 3 1 1 0 5 4 2 1
P2 5 4 2 6 0 0 3 0 2 8 4 4 1
P4 8 4 4 4 3 1 0 0 2 8 4 6 1
P3 8 4 6 0 1 1 2 1 1 10 5 7 1
[2]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P0 4 3 2 6 4 3 1 1 0 5 4 2 1
P3 5 4 2 0 1 1 2 1 1 7 5 3 1
P2 7 5 3 6 0 0 3 0 2 10 5 5 1
P4 10 5 5 4 3 1 0 0 2 10 5 7 1
[3]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P0 4 3 2 6 4 3 1 1 0 5 4 2 1
P3 5 4 2 0 1 1 2 1 1 7 5 3 1
P4 7 5 3 4 3 1 0 0 2 7 5 5 1
P2 7 5 5 6 0 0 3 0 2 10 5 7 1
[4]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P0 4 3 2 6 4 3 1 1 0 5 4 2 1
P4 5 4 2 4 3 1 0 0 2 5 4 4 1
P3 5 4 4 0 1 1 2 1 1 7 5 5 1
P2 7 5 5 6 0 0 3 0 2 10 5 7 1
[5]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P0 4 3 2 6 4 3 1 1 0 5 4 2 1
P4 5 4 2 4 3 1 0 0 2 5 4 4 1
P2 5 4 4 6 0 0 3 0 2 8 4 6 1
P3 8 4 6 0 1 1 2 1 1 10 5 7 1
[6]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P2 4 3 2 6 0 0 3 0 2 7 3 4 1
P0 7 3 4 6 4 3 1 1 0 8 4 4 1
P3 8 4 4 0 1 1 2 1 1 10 5 5 1
P4 10 5 5 4 3 1 0 0 2 10 5 7 1
[7]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P2 4 3 2 6 0 0 3 0 2 7 3 4 1
P0 7 3 4 6 4 3 1 1 0 8 4 4 1
P4 8 4 4 4 3 1 0 0 2 8 4 6 1
P3 8 4 6 0 1 1 2 1 1 10 5 7 1
[8]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P2 4 3 2 6 0 0 3 0 2 7 3 4 1
P3 7 3 4 0 1 1 2 1 1 9 4 5 1
P0 9 4 5 6 4 3 1 1 0 10 5 5 1
P4 10 5 5 4 3 1 0 0 2 10 5 7 1
[9]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P2 4 3 2 6 0 0 3 0 2 7 3 4 1
P3 7 3 4 0 1 1 2 1 1 9 4 5 1
P4 9 4 5 4 3 1 0 0 2 9 4 7 1
P0 9 4 7 6 4 3 1 1 0 10 5 7 1
[10]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P2 4 3 2 6 0 0 3 0 2 7 3 4 1
P4 7 3 4 4 3 1 0 0 2 7 3 6 1
P3 7 3 6 0 1 1 2 1 1 9 4 7 1
P0 9 4 7 6 4 3 1 1 0 10 5 7 1
[11]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P2 4 3 2 6 0 0 3 0 2 7 3 4 1
P4 7 3 4 4 3 1 0 0 2 7 3 6 1
P0 7 3 6 6 4 3 1 1 0 8 4 6 1
P3 8 4 6 0 1 1 2 1 1 10 5 7 1
[12]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P3 4 3 2 0 1 1 2 1 1 6 4 3 1
P2 6 4 3 6 0 0 3 0 2 9 4 5 1
P0 9 4 5 6 4 3 1 1 0 10 5 5 1
P4 10 5 5 4 3 1 0 0 2 10 5 7 1
[13]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P3 4 3 2 0 1 1 2 1 1 6 4 3 1
P2 6 4 3 6 0 0 3 0 2 9 4 5 1
P4 9 4 5 4 3 1 0 0 2 9 4 7 1
P0 9 4 7 6 4 3 1 1 0 10 5 7 1
[14]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P3 4 3 2 0 1 1 2 1 1 6 4 3 1
P0 6 4 3 6 4 3 1 1 0 7 5 3 1
P2 7 5 3 6 0 0 3 0 2 10 5 5 1
P4 10 5 5 4 3 1 0 0 2 10 5 7 1
[15]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P3 4 3 2 0 1 1 2 1 1 6 4 3 1
P0 6 4 3 6 4 3 1 1 0 7 5 3 1
P4 7 5 3 4 3 1 0 0 2 7 5 5 1
P2 7 5 5 6 0 0 3 0 2 10 5 7 1
[16]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P3 4 3 2 0 1 1 2 1 1 6 4 3 1
P4 6 4 3 4 3 1 0 0 2 6 4 5 1
P0 6 4 5 6 4 3 1 1 0 7 5 5 1
P2 7 5 5 6 0 0 3 0 2 10 5 7 1
[17]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P3 4 3 2 0 1 1 2 1 1 6 4 3 1
P4 6 4 3 4 3 1 0 0 2 6 4 5 1
P2 6 4 5 6 0 0 3 0 2 9 4 7 1
P0 9 4 7 6 4 3 1 1 0 10 5 7 1
[18]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P4 4 3 2 4 3 1 0 0 2 4 3 4 1
P2 4 3 4 6 0 0 3 0 2 7 3 6 1
P3 7 3 6 0 1 1 2 1 1 9 4 7 1
P0 9 4 7 6 4 3 1 1 0 10 5 7 1
[19]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3 2 1
P4 4 3 2 4 3 1 0 0 2 4 3 4 1
P2 4 3 4 6 0 0 3 0 2 7 3 6 1
P0 7 3 6 6 4 3 1 1 0 8 4 6 1
P3 8 4 6 0 1 1 2 1 1 10 5 7 1
[20]:
---------------------------安全序列------------------------------
Work Need Allocation Work+Allocation Finish
P1 1 3 0 0 2 0 3 0 2 4 3
- 1
- 2
前往页