Last Updated : 06 Dec, 2018

Consider a system a system having 31 resourses of same type. There are 5 processes P0, P1, P2, P3, P4. All resourses are shared by these process as following P1 – 7, P2 – 5, P, P4 – 4, P0 – X and P3 – Y. What is the maximum value of X and Y to ensure that the system will be deadlock free?
(A) 100
(B) 99
(C) 72
(D) 64


Answer: (B)

Explanation: The number of resources required for the system to be deadlock-free:
(X – 1)P0 + (7 – 1)P11 + (5 – 1)P2 + (Y – 1)P3 + (4 – 1)P4 + 1 = Total available resources.
(X – 1)P0 + (7 – 1)P11 + (5 – 1)P2 + (Y – 1)P3 + (4 – 1)P4 + 1 = 31
X + Y = 19.
There are two possibilities for resources allowed for P0 and P3 is either (X – 10, Y – 9) or (X – 9, Y -10)
The maximum value of X*Y = 99
So, option (B) is correct.


Quiz of this Question


Share your thoughts in the comments