CS FundamentalsVery hardGATE CS (PYQ pattern)

Deadlock detection (multiple instances of 3 resource types) with 6 processes. Allocation: P0 (2,0,2), P1 (1,2,1), P2 (1,0,1), P3 (1,0,0), P4 (1,1,1), P5 (2,2,2). Current Request: P0 (1,0,2), P1 (0,2,2), P2 (1,0,1), P3 (0,0,2), P4 (2,2,1), P5 (2,2,1). Available = (1,1,1). Which processes are deadlocked?

  1. A. P0, P2, P3
  2. B. P1, P4, P5, P2
  3. C. P1, P4, P5
  4. D. P1, P4

Correct answer: C. P1, P4, P5

Run the detection algorithm: repeatedly pick a process whose Request <= Work and release its allocation. The processes that can never be picked are P1, P4, P5.

More Operating Systems questions

Exams that ask this topic