CS FundamentalsHardProduct-company MCQ pattern

Five processes P0–P4 and three resource types A, B, C. Allocation: P0 (1,0,1), P1 (2,1,1), P2 (0,1,2), P3 (1,1,0), P4 (0,0,2). Max: P0 (4,2,3), P1 (3,2,2), P2 (2,3,4), P3 (3,1,2), P4 (1,2,3). Available: (1,1,1). Using the Banker's algorithm, which of these is a safe sequence?

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

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

Need = Max − Allocation: P0 (3,2,2), P1 (1,1,1), P2 (2,2,2), P3 (2,0,2), P4 (1,2,1). Only P1 fits in (1,1,1); then Work = (3,2,2) → P3 → (4,3,2) → P4 → (4,3,4) → P0 → (5,3,5) → P2. Starting with P3 or P4 fails because their need exceeds (1,1,1).

More Operating Systems questions

Exams that ask this topic