CS FundamentalsHardGATE CS

A system has resource types A, B, C. Available = (2,1,0). Allocation: P0 (1,1,0), P1 (0,1,2), P2 (2,0,1), P3 (1,0,0). Max: P0 (3,2,2), P1 (1,2,3), P2 (3,1,1), P3 (2,2,1). Which statement is correct?

  1. A. The state is unsafe because Available has no instance of C
  2. B. The state is safe and P3 must run first
  3. C. The state is safe and every order of the four processes is a safe sequence
  4. D. The state is safe; P3 cannot be the first process in any safe sequence

Correct answer: D. The state is safe; P3 cannot be the first process in any safe sequence

Need = Max − Allocation: P0 (2,1,2), P1 (1,1,1), P2 (1,1,0), P3 (1,2,1). With Available = (2,1,0) only P2 (need 1,1,0) can start; after it releases, Available grows and the rest follow. A safe sequence exists, e.g. P2 → P1 → P0 → P3. P3 needs (1,2,1), more B than the 1 available, so it cannot go first; an empty Available column alone does not make a state unsafe.

More Operating Systems questions

Exams that ask this topic