Consider the following process and resource requirement of each process. Type…

2013

Consider the following process and resource requirement of each process.

                 Type 1        Type 2
Process         Used  Max      Used  Max
   P1            1     2         1    3
   P2            1     3         1    2
   P3            2     4         1    4 

Predict the state of this system, assuming that there are a total of 5 instances of resource type 1 and 4 instances of resource type 2.

  1. A.

    Can go to safe or unsafe state based on sequence

  2. B.

    Safe state

  3. C.

    Unsafe state

  4. D.

    Deadlock state

Attempted by 97 students.

Show answer & explanation

Correct answer: C

First, calculate the available resources for each type by subtracting total used from total instances. For Type 1: Total is 5, Used is 4 (1+1+2), so Available = 1. For Type 2: Total is 4, Used is 3 (1+1+1), so Available = 1. The Available Vector is [1, 1].

Next, calculate the remaining need for each process using (Max - Used). P1 Need = [2-1, 3-1] = [1, 2]. P2 Need = [3-1, 2-1] = [2, 1]. P3 Need = [4-2, 4-1] = [2, 3].

Finally, check if any process can be satisfied with the available resources [1, 1]. P1 needs 2 of Type 2 (Available is 1). P2 needs 2 of Type 1 (Available is 1). P3 needs more than available. Since no process can proceed, the system is in an unsafe state.

Explore the full course: Isro