In: Computer Science
Consider the following snapshot of a system that has four
resource types: A, B,
C, and D and five processes, P0, P1, P2, P3, and P4.
Allocation Max
A B C D A B C D
P0 3 0 1 5 5 1 1 7
P1 2 2 1 0 3 2 1 1
P2 3 1 2 1 3 3 2 1
P3 0 5 1 0 4 6 1 2
P4 4 2 1 3 6 3 2 5
Consider the situation in which Available = (0, 2, 1, 2). Give
an example of a request
from P0 that can be served from the available resources, does not
violate the maximum resources declared by the process but causes
the system to be in a non-safe state as defined by the banker’s
algorithm. Show all work (how the Available array changes after
each step of the algorithm).
Greetings!!
At present, the allocation,max,need and available resouces are as shown below:
ie 0,2,0,0 <= 0,2,1,2
Now P1 can proceed followed by P3 and P4
Hence all the processes completed their execution and the system is in safe state and the safe sequence is P2,P0,P1,P3 and P4.
No other request only by P0 will not make the system unsafe state. If more than one process change their request an unsafe state can occur.
Hope this helps