GATE CSE 2021 Set 2 Q53: Resource scheme that kills and restarts the owner
- Operating System
- 2 marks
- MSQ
- No negative marking
Question
Consider a computer system with multiple shared resource types, with one instance per resource type. Each instance can be owned by only one process at a time. Owning and freeing of resources are done by holding a global lock (L). The following scheme is used to own a resource instance:
function OwnResource(Resource R)
Acquire lock L // a global lock
if R is available then
Acquire R
Release lock L
else
if R is owned by another process P then
Terminate P, after releasing all resources owned by P
Acquire R
Restart P
Release lock L
end if
end if
end functionWhich of the following choice(s) about the above scheme is/are correct?
Try it: multiple select: one or more correct options
Show answer and explanation
Answer: A, B, C (official GATE 2021 final answer key)
Concept used: Pre-empting resources (killing the holder) breaks the no-preemption condition for deadlock, at the cost of repeated restarts.
First step: Check the four Coffman conditions: which one does the scheme remove? Then imagine two processes repeatedly taking each other's resource.
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2021 Set 2 CS question paper and final answer key, organised by IIT Bombay. Question paper · Answer key
More Operating System PYQs
- 2026 Session 1 · Q29False statements about deadlocks
- 2026 Session 1 · Q35Minimum resource instances for deadlock freedom (5 processes, max 2)
- 2026 Session 1 · Q59Disk transfer time for random sectors on tracks 5, 12, 7
- 2026 Session 1 · Q63Number of printf calls with fork, continue and break
- 2026 Session 1 · Q64Average FCFS waiting time for alternating A and C processes
- 2026 Session 2 · Q23CPU scheduling algorithm that cannot be preemptive