357 views
0 votes
0 votes

How can it be (d)??

1 Answer

Best answer
2 votes
2 votes

Here we have to remember 2 things :

a)  A process Pi can be allocated resources maintaining the safety property iff  need(Pi)  <=  available for each type of resources (in this case we have to check for each of A , B and C )

b) After this process which satisfies the above property and is completed execution we set its flag == FALSE indicating that it will not come again unless other processes are services.So after execution of it , release of its resources allocated to it is nescessary.So available no of resources will obviously increase.So we do ,

Available = Available + Allocation(Pi) for each of A,B and C resource type.

Now let us check for option B) firstkeeping in mind the above mentioned points

Initially available =  [ 2   3    0]

Now need(P3)    =   [ 0   1    1]

So we can see need(P3)  for type C is 1 which is less than available resource of type C which is 0.

So here itself the criteria for selection of P3 fails.

So P3 cannot come first in safe sequence.

Hence both B and C are false.

Therefore the correct option should be A)

selected by

Related questions

0 votes
0 votes
2 answers
1
Deepalitrapti asked Jun 10, 2019
441 views
0 votes
0 votes
1 answer
2
Soumya Tiwari asked Dec 1, 2018
609 views
Given memory partition in the order below:P1:100k P2:500k P3:800k P4:300k P5:600k.How would Worst Fit algo place processes :212k,417k,112k and 426k (in order)
0 votes
0 votes
0 answers
4
eyeamgj asked Aug 14, 2018
246 views