CS FundamentalsVery hardGATE CS · Advanced

The Banker's algorithm is applied to 5 processes P0-P4 and 3 resource types with Available = (1, 1, 3). P0: Allocation (1, 2, 1), Max (1, 5, 2); P1: Allocation (1, 0, 0), Max (4, 3, 1); P2: Allocation (2, 0, 1), Max (3, 1, 1); P3: Allocation (2, 1, 2), Max (2, 2, 2); P4: Allocation (0, 1, 2), Max (3, 1, 4). How many different safe sequences (orderings of all five processes in which each process can finish in turn) exist?

  1. A. 12
  2. B. 15
  3. C. 24
  4. D. 10

Correct answer: A. 12

Need = Max - Allocation. Explore every order in which a process whose need fits the current Work can run and then releases its allocation; counting all complete orders gives 12.

More Operating Systems questions

Exams that ask this topic