647 views
0 votes
0 votes

any shortcut method for this??

1 Answer

2 votes
2 votes

Need=Max- Allocation

P0=(7 4 3)

P1=(1 2  2)

P2=(6 0 0)

P3=(0 1 1)

P4=(4 3 2)

Now check 

Case1: if Need >Available then WAIT

Case2: if Need ≤Available then GRANT

And update Available, Available=Available+ Allocation

P0=Case1

P1= Case2  •°• Available=(5 3 2)

P2= Case1

P3= Case2  •°• Available=(7 4 3)

P4= Case2  •°• Available=(7 4 5)

P2=Case2  •°• Available=(10 4 7)

Now turn is P0

Then safe sequence is P1->P3->P4->P2->P0

______________________________________________

There is no short cut to determine safe sequence or Bankers Algorithm. We have to calculate it. 

Related questions

0 votes
0 votes
2 answers
2
iarnav asked Apr 10, 2017
1,397 views
Hello guys, I'm seeing a lot of questions on disk scheduling asked by various folks, but in GATE CS syllabus of OS - there's no topic as disk scheduling. So, please point...