CS FundamentalsVery hardCapgemini · Cognizant GenC

Deadlock detection with 3 resource types, 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. No process is deadlocked
  2. B. P1 and P2 only
  3. C. P0, P2 and P4
  4. D. P1, P2, P3 and P4

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

P0 has a zero request and finishes, releasing (0,1,0), giving Work = (0,1,0). No other request fits within (0,1,0): P1 needs (2,0,2), P2 (0,0,1), P3 (1,0,0), P4 (0,0,2). So P1 to P4 are deadlocked.

More Operating Systems questions

Exams that ask this topic