retagged by
773 views

2 Answers

Best answer
1 votes
1 votes

Given the available Resources(A,B,C,D) =  0 0 1 1

  1. We can service the need of P3 which is 0 0 1 0, so once P3 is executed, it releases all the resources it was holding making total available as 1 1 3 2.
  2. Next we can service the need of P1 which is 1 0 0 0, so once P1 is executed, it releases all the resources it was holding making total available as 3 2 4 3.
  3. Next the need of P2 is 0 2 X 2, Now to make the system unsafe we need to have value of X > 4 as 4 is the current availability of Resource C. Hence the smallest value of X = 5.
selected by
1 votes
1 votes

Answer: 5

The need table suggests the future need. 

Now the available resources in terms of $(A,B,C,D) = 0,0,1,1$

We can first satisfy $P3$ (b/c it needs $0,0,1,0$). Once $P3$ is satisfied it gives all the resources that it is currently allocated with, i.e. $1,1,2,1$. Thus, new available = $0,0,1,1 + 1,1,2,1 = 1,1,3,2$

With new available = $1,1,3,2$ we can satisfy $P1$ (b/c it needs $1,0,0,0$). Once $P1$ is satisfied it gives all the resources that it is currently allocated with, i.e. $2,1,1,1$. Thus, new available = $1,1,3,2 + 2,1,1,1 = 3,2,4,3.$

Now we to satisfy P2, P2 needs $0,2,X,2$. We can see that our available resources in $C = 4.$ So, with $4$ we can safely satisfy $P2$’s needs, and thus the system will be safe.

But the question asks 

the smallest value of X for which the system will not be in safe state

This will happen only if X is such that it can’t be satisfied with our current available $C$ i.e $4$. Hence $X$ must be $5$.

Related questions

0 votes
0 votes
0 answers
1
0 votes
0 votes
1 answer
2
DAWID15 asked Dec 22, 2022
529 views
Options:10, 12,14, 16, 18, 2020, 18, 16, 14, 12, 1012, 10, 16, 14, 20, 18NONE
1 votes
1 votes
0 answers
3
Prince Sindhiya asked Oct 11, 2018
235 views
0 votes
0 votes
0 answers
4