182
Example of the banker’s algorithm
n
We have 3 resources types with amount:
u
R(1) = 9, R(2) = 3, R(3) = 6
n
and have 4 processes with initial state:
Claimed
Allocated
Available
3
2
2
6
1
3
3
1
4
4
2
2
1
0
0
5
1
1
2
1
1
0
0
2
1
1
2
P1
P2
P3
P4
n
Suppose that P2 is requesting Q = (1,0,1).
Should this request be granted?
R1
R2
R3
R1
R2
R3
R1
R2
R3