1,240 views
0 0 votes

any shortcut method for this??

1 Answer

2 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. 

Position:
Show:

Related questions

0 0 votes
2 2 answers
7.7k
7.7k views
Na462 asked Jul 18, 2018
7,738 views
Suppose a disk has 200 cylinders numbered from 0 to 199. At some time, disk arm is at cylinder 76 and there is a queue of disk access requests for cylinders:54, 32, 108, ...
0 0 votes
2 answers 2 answers
2.1k
2.1k views
iarnav asked Apr 10, 2017
2,089 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...
3 3 votes
1 1 answer
154
154 views
GO Classes asked Aug 26
154 views
A disk contains tracks numbered from $0$ through $199$.The disk head is currently at track $184$.The pending requests, in arrival-list order, are $184, 187, 176, 182, 199...
1 1 vote
4 4 answers
1.3k
1.3k views