edited by
1,146 views
0 votes
0 votes

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. $\left \langle p_0, p_1, p_2 \right \rangle$
  2. $\left \langle p_1, p_0, p_2 \right \rangle$
  3. $\left \langle p_2, p_1, p_0 \right \rangle$
  4. $\left \langle p_0, p_2, p_1 \right \rangle$
edited by

2 Answers

0 votes
0 votes
Available resource ≥ remaining need of p1
Using 3 resources, p1 gets executed first. It frees 2 resources.
Available resources = 3 + 2 = 5
Available resource ≥ remaining need of p0
Using 5 resources, p0 gets executed first. It frees 5 resources.
Available resources = 5 + 5 = 10
Available resource ≥ remaining need of p2
Now, p2 can be executed easily. Hence, (p1, p0, p2) is a safe sequence.

Related questions

1 votes
1 votes
2 answers
1
4 votes
4 votes
6 answers
3
soujanyareddy13 asked May 12, 2021
1,859 views
The Boolean expression $AB+A \overline{B}+\overline{A}C+AC$ is unaffected by the value of the Boolean variable _________.$A$$B$$C$$A, B$ and $C$