GATE / CS ARCHIVE

GATE CSE 2000 / QUESTION 2.23

A rule that fails to prevent deadlock

Operating Systems · Deadlocks · Full GATE CSE 2000 paper

GATE 2000, Q2.23 2 marks · MCQ
Report issue

Deadlocks

Question 2.23, GATE 2000: Which is not a valid general prevention policy: release all before requesting a new resource; request only in increasing resource-number order; never request after releasing any resource; acquire all required resources before execution?
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Step 1: Releasing all held resources before a new request removes hold-and-wait. A global increasing order removes circular wait. Atomic acquisition of the full required set before running also avoids partial hold-and-wait.

Step 2: Merely forbidding requests after the first release does not prevent deadlock during the initial acquisition phase. Process P can hold A and request B while Q holds B and requests A; neither has released anything, so both obey that rule.

Thus C is insufficient. The prevention interpretation presumes the usual nonreentrant-resource model and an all-or-nothing initial acquisition policy in the last option.

Original paper, page 6