IAE Academy

GATE 2025 CS2 Q.48: solution and answer

GATE 2025 · CS2Q.48 · 2 marks · MSQ

consists of all active processes in an operating system. consists of single instances of distinct types of resources in the system.

The resource allocation graph has the following assignment and claim edges.

Assignment edges: (the assignment edge means resource is assigned to process , and so on for others)

Claim edges: (the claim edge means process is waiting for resource , and so on for others)

Which of the following statement(s) is/are CORRECT?

  1. (A)

    Aborting makes the system deadlock free.

  2. (B)

    Aborting makes the system deadlock free.

  3. (C)

    Aborting makes the system deadlock free.

  4. (D)

    Aborting and makes the system deadlock free.

See the question in the paper

Answer and solution

ANSWER

The correct statements are (C) and (D).

Official answer: C, DSource: Official answer key, GATE 2025 CS2 (IIT Roorkee)

  1. Every resource has a single instance, so a cycle in the resource allocation graph means deadlock, and no cycle means no deadlock. Convert to a wait-for graph: if waits for a resource held by .

  2. Holders: is held by , by , by , by .

  3. Waiting edges give: (via ), (via ), (via ), (via ), (via ).

  4. Cycles in the wait-for graph: and . Both pass through .

  5. (A) Abort : the edges and remain, so the cycle remains. Deadlock persists. False.

  6. (B) Abort : the edges and remain. Deadlock persists. False.

  7. (C) Abort : it releases , and and withdraws its requests. Every cycle used , so the only edge left is , which has no cycle. True.

  8. (D) Abort and : both edges out of and into and disappear, so only remains. No cycle. True.

  9. Correct options: (C) and (D).

KEY IDEA

With single-instance resources, deadlock is exactly a cycle in the wait-for graph. Here both cycles pass through , so aborting breaks both. Aborting also breaks both, one process per cycle.

WATCH OUT FOR

Aborting only one process of the three-process cycle ( or ) and forgetting the second cycle that does not contain it.

From the GATE 2025 CS2 paper. Every question of this paper · Download the full paper · All 6 Deadlock questions, with notes

More Deadlock questions