1.
Consider the following snapshot of a system:
Max
Allocation
Available
ABC
ABC
ABC
P0
001
001
P1
175
100
P2
235
135
P3
065
063
Total
299
152
How many resources are there of type (A,B,C)?
What is the contents of the Need matrix?
Is the system in a safe state? Why?
If a request from process P1 arrives for additional resources of (0,5,2), can the Banker's
algorithm grant the request immediately?
What would be the new system state after the allocation?
2. Consider the following snapshot of a system:
Allocation
Max
Need
Total
ABC
ABC
ABC
ABC
P0
010
753
743
10 5 7
P1
200
322
122
Allocated
P2
302
902
600
725
P3
211
222
011
Available
P4
002
433
431
332
Is the state safe?
Can request for (3,3,0) by P4 be granted?
Can request for (0,2,0) by P0 be granted?
3. Consider the following snapshot of a system:
Allocation
Max
Available
ABCD
ABCD
P0
0012
0012
P1
1000
1750
P2
1354
2356
P3
0632
0652
P4
0014
0656
ABCD
1520
Answer the following questions using the bankers algorithm:
a. What is the content of the matrix Need?
b. Is the system in a safe state?
c. If a request from process P1 arrives for (0,4,2,0), can the request be granted
immediately?
4. Consider the following snapshot of a system:
Allocation
Max
Available
ABCD
ABCD
ABCD
P0
1012
0012
0421
P1
0012
1750
P2
1053
2356
P3
0524
0652
P4
1114
0656
Answer the following questions using the bankers algorithm:
a. What is the content of the matrix Need?
b. Is the system in a safe state?
c. If a request from process P1 arrives for (0,4,2,0), can the request be granted
immediately?
5. Consider the following snapshot of a system:
Allocation
Max
Available
ABCD
ABCD
ABCD
P0
1112
0012
1520
P1
1002
1750
P2
1353
2356
P3
0532
0652
P4
0014
0656
Answer the following questions using the bankers algorithm:
a. What is the content of the matrix Need?
b. Is the system in a safe state?
c. If a request from process P1 arrives for (0,0,4,2), can the request be granted
immediately?
6. Consider the following snapshot of a system:
Allocation
Max
Available
ABCD
ABCD
ABCD
P0
0012
1101
1520
P1
1000
0641
P2
1354
1356
P3
0632
0552
P4
0014
0646
Answer the following questions using the bankers algorithm:
d. What is the content of the matrix Need?
e. Is the system in a safe state?
f. If a request from process P1 arrives for (0,0,4,2), can the request be granted
immediately?
7. Consider the following snapshot of a system:
Allocation
Max
Available
ABCD
ABCD
ABCD
P0
0012
0012
1520
P1
1111
1750
P2
1354
2356
P3
0630
0652
P4
0014
0656
Answer the following questions using the bankers algorithm:
g. What is the content of the matrix Need?
h. Is the system in a safe state?
i. If a request from process P1 arrives for (0,0,4,2), can the request be granted
immediately?
8. Consider the following snapshot of a system:
Allocation
Max
Available
ABCD
ABCD
ABCD
P0
0012
0012
4321
P1
1001
1550
P2
1354
2356
P3
0632
0552
P4
0014
0655
Answer the following questions using the bankers algorithm:
j. What is the content of the matrix Need?
k. Is the system in a safe state?
l. If a request from process P1 arrives for (0,0,4,2), can the request be granted
immediately?
9. Consider the following snapshot of a system:
Allocation
Max
Available
ABCD
ABCD
ABCD
P0
0012
0012
2341
P1
1020
1750
P2
1354
2356
P3
0532
0652
P4
0214
0656
Answer the following questions using the bankers algorithm:
m. What is the content of the matrix Need?
n. Is the system in a safe state?
o. If a request from process P1 arrives for (0,0,4,2), can the request be granted
immediately?
10. Consider the following snapshot of a system:
Allocation
Max
Available
ABCD
ABCD
ABCD
P0
1112
1212
1520
P1
1000
1751
P2
1354
2355
P3
0632
0653
P4
0014
0656
Answer the following questions using the bankers algorithm:
p. What is the content of the matrix Need?
q. Is the system in a safe state?
r. If a request from process P1 arrives for (0,0,4,2), can the request be granted
immediately?