The GATE Grind

GATE 2022 CS – Question 26

Operating System · Deadlock · 1 mark · Multiple select

Which of the following statements is/are TRUE with respect to deadlocks?

  1. Circular wait is a necessary condition for the formation of deadlock.
  2. In a system where each resource has more than one instance, a cycle in its wait-for graph indicates the presence of a deadlock.
  3. If the current allocation of resources to processes leads the system to unsafe state, then deadlock will necessarily occur.
  4. In the resource-allocation graph of a system, if every edge is an assignment edge, then the system is not in deadlock state.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (A) Circular wait is a necessary condition for the formation of deadlock.; (D) In the resource-allocation graph of a system, if every edge is an assignment edge, then the system is not in deadlock state.

Explanation

Circular wait is one of the four necessary conditions. With only assignment edges, no process is waiting, so there is no deadlock. With multiple instances a cycle is only necessary, not sufficient, and an unsafe state does not necessarily lead to deadlock.