The GATE Grind

GATE 2021 CS (CS2) – Question 53

Operating System · Deadlock · 2 marks · Multiple select

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?

  1. Deadlocks do not occur
  2. Livelock may occur
  3. Starvation may occur
  4. Resource mutual exclusion is violated

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.

More Deadlock questions

All Deadlock questions →