The GATE Grind

GATE 2015 CS (CS3) – Question 45

Operating System · Deadlock · 2 marks · Multiple choice

Which policies prevent deadlock with mutually exclusive resources?
I: Acquire all resources at the beginning; if any are unavailable, release all acquired resources.
II: Number resources uniquely and request only in increasing order.
III: Number resources uniquely and request only in decreasing order.
IV: Request a resource only if its number is larger than every currently held resource.

  1. I and III but not II or IV
  2. I,III,IV but not II
  3. II and III but not I or IV
  4. Any of I,II,III,IV

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (D) Any of I,II,III,IV

Explanation

I removes hold-and-wait by requiring all-or-release acquisition. II and IV impose a strict increasing order; III imposes a strict decreasing order. Either consistent total ordering prevents circular wait. Therefore each policy can prevent deadlock, D.

More Deadlock questions

All Deadlock questions →