189
Deadlock detection: example
n
Mark P4 since it has no allocated resources
n
Set W = (0,0,0,0,1)
n
P3’s request <= W. So mark P3 and set W =
W + (0,0,0,1,0) = (0,0,0,1,1)
n
Algorithm terminates. P1 and P2 are
deadlocked
R1
R2
R3
R4
R5
P1
P2
P3
P4
Request
Allocated
Available
R1
R2
R3
R4
R5
R1
R2
R3
R4
R5
0
1
0
0
1
0
0
1
0
1
0
0
0
0
1
1
0
1
0
1
1
0
1
1
0
1
1
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1