GATE / CS ARCHIVE

GATE CSE 2025 SET 2 / QUESTION 48

GATE CSE 2025 Set 2 Q48

Operating Systems · Deadlocks · Full GATE CSE 2025 Set 2 paper

GATE 2025 Set 2, Q48 2 marks · MSQ
Report issue

Deadlocks

Question 48, GATE 2025: There are processes P1,…,P4 and one instance each of resources R1,…,R4. Ri is assigned to Pi. Current waits are P1→R2, P2→R3, P3→R1, P2→R4, P4→R2. The question calls these wait edges “claim edges.” Which actions make the system deadlock-free?
A. Abort P1 alone. B. Abort P3 alone. C. Abort P2 alone. D. Abort P1 and P4.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: C, D

Step through it (5 checks)

Convert each wait on a resource into a wait on its current owner. The wait-for graph has edges P1→P2, P2→P3, P3→P1, P2→P4, P4→P2. It contains the cycles P1→P2→P3→P1 and P2→P4→P2. With one instance of each resource and actual blocking waits, such cycles characterize deadlock.

Aborting P1 removes the first cycle but leaves P2↔P4, so A fails. Aborting P3 has the same problem, so B fails. Aborting P2 removes a vertex common to both cycles. Remaining waits can be satisfied as resources are released, with no cycle left; C works. Aborting P1 and P4 removes one vertex from each cycle, leaving only P2→P3 among the surviving wait edges, so D also works.

The question asks which listed sets suffice, not which set uses the minimum number of abortions. Hence D remains correct even though C resolves the problem with fewer abortions. Use the question's explicit interpretation of “claim” as a current wait; a future potential-claim edge in deadlock-avoidance terminology would not imply the same present deadlock. Select C,D.

Original paper, page 37 · Answer key