CS FundamentalsVery hardGATE CS (PYQ pattern)

A system has 3 resource types and processes P0-P3. Allocation: P0 (1,0,1), P1 (2,1,0), P2 (1,1,1), P3 (0,1,2). Maximum: P0 (3,2,2), P1 (4,1,2), P2 (2,2,2), P3 (1,3,3). Available = (1,2,1). By the Banker's algorithm, the number of distinct safe sequences is:

  1. A. 6
  2. B. 8
  3. C. 12
  4. D. 24

Correct answer: B. 8

Need = P0 (2,2,1), P1 (2,0,2), P2 (1,1,1), P3 (1,2,1). Only P2 and P3 can start; trying every order after each allocation release and counting those where all four finish gives 8 safe sequences.

More Operating Systems questions

Exams that ask this topic