CS FundamentalsVery hardGATE CS

Deadlock detection (multi-instance). Available = (0,0,0). Allocation: P0 (0,1,0), P1 (2,0,0), P2 (3,0,3), P3 (2,1,1), P4 (0,0,2). Current Request: P0 (0,0,0), P1 (2,0,2), P2 (0,0,1), P3 (1,0,0), P4 (0,0,2). Which processes are deadlocked?

  1. A. None
  2. B. Only P2
  3. C. P1, P2, P3 and P4
  4. D. P1 and P2 only

Correct answer: C. P1, P2, P3 and P4

P0 requests nothing, so it can finish and release (0,1,0), giving Work = (0,1,0). No other request fits: P1 needs (2,0,2), P2 needs a C, P3 needs an A, P4 needs two Cs, and nothing else frees up. So P1, P2, P3, P4 are deadlocked.

More Operating Systems questions

Exams that ask this topic