UGC NET Paper 2 (Computer Science)Very hard

Three processes P0, P1, P2 request two resource types X and Y. Available = (2, 1). Allocation: P0 = (0, 0), P1 = (1, 0), P2 = (0, 1). Max: P0 = (2, 2), P1 = (1, 1), P2 = (2, 1). Using the Banker's algorithm, a safe sequence is:

  1. A. P1, P2, P0
  2. B. P0, P1, P2
  3. C. P2, P0, P1
  4. D. No safe sequence exists

Correct answer: A. P1, P2, P0

Need = Max - Allocation gives P0=(2,2), P1=(0,1), P2=(2,0); starting from Work=(2,1), P1's need is met first, releasing (3,1) for P2, then (3,2) covers P0's need, so P1,P2,P0 is safe.

More UGC NET Computer Science and Applications questions

Exams that ask this topic