Skip to content

UGC NET CS 2019System Software and Operating System › DeadlocksVerified

UGC NET CS 2019 PYQ: Suppose a system has 12 magnetic tape drives and at time $t_0$, three processes are allotted tape drives out…

Suppose a system has 12 magnetic tape drives and at time $t_0$, three processes are allotted tape drives out of their need as given below:

$$\begin{array}{ccc} & \text{Maximum Needs} & \text{Current Needs} \\ p_0 & 10 & 5 \\ p_1 & 4 & 2 \\ p_2 & 9 & 2 \end{array}$$

At time $t_0$, the system is in safe state. Which of the following is safe sequence so that deadlock is avoided?

  1. A
    $\left \langle p_0, p_1, p_2 \right \rangle$
  2. B
    $\left \langle p_1, p_0, p_2 \right \rangle$
    Correct answer
  3. C
    $\left \langle p_2, p_1, p_0 \right \rangle$
  4. D
    $\left \langle p_0, p_2, p_1 \right \rangle$

Answer

(B) $\left \langle p_1, p_0, p_2 \right \rangle$

Approach

Run the Banker safety algorithm using the available drives and remaining needs.

Reviewed by UGC IQ Editorial Team.