Deadlock AvoidanceSolutionA The values of NEED for the proce
Deadlock Avoidance
Solution
A. The values of NEED for the processes p1 through p5 respectively are (0, 0, 0, 0), (0, 7, 5, 0), (6, 6, 2, 2), (2, 0, 0, 2) and (0, 3, 2, 0)
B. Yes, the system is in safe state. Given that Available is (2, 1, 0, 0). So either process p4 or p5 could run. Once process p4 runs, it releases its resources, which allow all other existing processes to run.
C. Assuming that the allocation can be made as the Available is (2, 1, 0, 0). Now it becomes (2, 0, 0, 0) and the allocation for p3 becomes (1, 1, 0, 0) and need for p3 becomes (1, 1, 0, 0). So the possible safe sequence will be: p1, p2, p5, p4, p3
D. Yes the request from process p3 can be granted as there is a safe sequence.
