GATE | GATE CS 1997 | Question 47

An operating system contains 3 user processes each requiring 2 units of resource R. The minimum number of units of R such that no deadlocks will ever arise is
(A) 3
(B) 5
(C) 4
(D) 6


Answer: (C)

Explanation: Total process = 3 and each require 2 units of resource.

If we give 1 resource to 1 process then total resource = 1 + 1 + 1 = 3 but in this case deadlock will definitely occur because each process hold 1 unit resource and waiting for another resource so if we increase 1 more resource (3+1=4) then deadlocks will ever arise (i.e., when process 1 complete their execution then it free 2 resource and this 2 resource will used by another process.).

Option (B) is correct.

Quiz of this Question

My Personal Notes arrow_drop_up

Improved By : ApurvaRaj

Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.