CS FundamentalsVery hardGATE CS

Deadlock detection, resources (A, B, C), Available = (1, 0, 0). Allocation / Request: P1 (0,1,0) / (1,0,0), P2 (1,0,1) / (0,2,0), P3 (0,1,1) / (1,0,1), P4 (1,0,0) / (0,0,2). Which processes are deadlocked?

  1. A. P2, P3 and P4
  2. B. None; all can finish
  3. C. P2 and P3 only
  4. D. All four

Correct answer: A. P2, P3 and P4

P1's request fits, so it finishes and releases (0,1,0), making Available (1,1,0). P2 needs two B, P3 needs a C and P4 needs two C; none fits, so P2, P3 and P4 are deadlocked. P1 is not, because its request could be met.

More Operating Systems questions

Exams that ask this topic