Consider the following system snapshot using data structures in the Banker’s algorithm, with resources A, B, C, and D, and process P0 to P4:
- How many resources of type A, B, C, and D are there?
- What are the contents of the Need matrix?
- Is the system in a safe state? Why
- If a request from process P4 arrives for additional resources of (1,2,0,0,), can the Banker’s algorithm grant the request immediately? Show the new system state and other criteria.
Ans:
(a) A-9; B-13;C-10;D-11
(b) Need[i, j]=Max[i,j]-Allocation[i,j] so content of Need matrix is ABCD
(d) If a request from process P4 arrives for additional resources of (1,2,0,0,), and if this request is granted, the new system state would be tabulated as
follows.
(a) A-9; B-13;C-10;D-11
(b) Need[i, j]=Max[i,j]-Allocation[i,j] so content of Need matrix is ABCD
-
P0 2 0 1 1
-
P1 0 6 5 0
-
P2 1 1 0 2
-
P3 1 0 2 0
-
P4 1 4 4 4
(d) If a request from process P4 arrives for additional resources of (1,2,0,0,), and if this request is granted, the new system state would be tabulated as
follows.
0 comments:
Feel free to contact the admin for any suggestions and help.