0% found this document useful (0 votes)
33 views3 pages

Bankers Algorithm For Single and Multiple Resouce

Uploaded by

Virti Doshi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views3 pages

Bankers Algorithm For Single and Multiple Resouce

Uploaded by

Virti Doshi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

→ Bankers Algorithm for Single resource

→ Bankers Algorithm for multiple resources

Single resource Snapshot of system -1 :

Process P0 P1 P2 P3
Alloted 2 X X X
Required 18 X X X

Free: 15
P1→ P2 → P3 → Deadlock(P0)

Sequence: P2 → P3 → P1 → P0 → Safe state

Single resource, Snapshot of system -2:

Process P0 P1 P2 P3
Alloted 2 4 X X
Required 11 13 X X

Free: 9
Sequence: P2 → P3 → Deadlock → Unsafe state
Dry Run

Bankers with multiple resource:


Allotted: Total Required(Maximum):

Process/ A B C D Process/ A B C D
Resource Resource
P0 5 6 2 3 P0 7 9 11 14
P1 1 4 2 5 P1 5 7 9 10
P2 2 4 5 7 P2 12 13 14 15
P3 3 5 6 7 P3 9 8 6 9
P4 1 2 3 4 P4 7 8 9 10
P5 4 3 2 1 P5 3 5 6 7

Availability Vector:
[1 2 5 6]

Need Matrix: = Max- Alloted

Process/Resource A B C D
P0 2 3 9 11
P1 4 3 7 5
P2 10 9 9 8
P3 6 3 0 2
P4 6 6 6 6
P5 0/-1 2 4 6 X

Sequence: P5→ P1 → P3
AVA I { 1 0 1 0}
Rel P5{ 4 5 6 7}
AVA [ 5 5 7 7]

Process/Resource A B C D
P0 2 3 9 11
P1 4 3 7 5
P2 10 9 9 8
P3 6 3 0 2
P4 6 6 6 6
P5 0/-1 2 4 6 X
AVA [ 5 5 7 7]

AVA i { 1 2 0 2 }
P1 { 5 7 9 10}
AVA [ 6 9 9 12]

i Calculate the need matrix: 2-3 Marks

ii 6-7 marks

iii Total resources available in the end

You might also like