GATE 2021 CS (CS2) – Question 53
There is one instance of each resource type. Under a global lock L, OwnResource(R) acquires R if available. Otherwise it terminates the other owner P, releases all resources held by P, acquires R, restarts P and releases L. Which statements hold?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) Deadlocks do not occur; (B) Livelock may occur; (C) Starvation may occur
Explanation
Requests never wait in a cycle for resources: a conflicting owner is terminated and its resources released, preventing deadlock. However competing processes can repeatedly terminate/restart each other without completing, causing livelock. A repeatedly victimized process can starve. Global locking and single ownership preserve mutual exclusion. Select A,B,C.