What is the minimum number of resources required to ensure that deadlock will…
2014
What is the minimum number of resources required to ensure that deadlock will never occur, if there are currently three processes P1, P2 and P3 running in a system whose maximum demand for the resources of same type are 3, 4, and 5 respectively.
- A.
3
- B.
7
- C.
9
- D.
10
Attempted by 140 students.
Show answer & explanation
Correct answer: D
To guarantee deadlock avoidance, the total number of resources must be sufficient to allow at least one process to complete its execution.
In the worst-case scenario, each process holds one less resource than its maximum demand.
For P1, P2, and P3 with maximum demands of 3, 4, and 5 respectively:
P1 holds 3-1=2 resources.
P2 holds 4-1=3 resources.
P3 holds 5-1=4 resources.
Summing these gives 2 + 3 + 4 = 9 resources held.
Adding one more resource ensures at least one process can finish, totaling 9 + 1 = 10 resources.