A total of 9 units of a resource type available, and given the safe state…

2011

A total of 9 units of a resource type available, and given the safe state shown below, which of the following sequence will be a safe state?

Process   Used    Max
  P1        2      7
  P2        1      6
  P3        2      5
  P4        1      4
  1. A.

    (P4, P1, P3, P2)

  2. B.

    (P4, P2, P1, P3)

  3. C.

    (P4, P2, P3, P1)

  4. D.

    (P3, P1, P2, P4)

Attempted by 101 students.

Show answer & explanation

Correct answer: D

First, calculate the available resources: Total (9) - Sum of Used (2+1+2+1=6) = 3 units.

Next, determine the Need for each process (Max - Used): P1=5, P2=5, P3=3, P4=3.

With 3 units available, P3 or P4 can execute. If P3 runs first, it releases 2 units, making Available = 5.

With 5 units available, P1 or P2 can execute. If P1 runs next, it releases 2 units, making Available = 7.

With 7 units available, P2 can execute (Need 5), releasing 1 unit. Finally, P4 executes.

Thus, the sequence P3 → P1 → P2 → P4 is a valid safe sequence.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Isro