Banker

You might also like

Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 4

Allocation Max Available NEED

A B C A B C A B C
P0 0 1 0 7 5 3 3 3 2 A B
P1 2 0 0 3 2 2 P0 7 4
P2 3 0 2 9 0 2 P1 1 2
P3 2 1 1 2 2 2 P2 6 0
P4 0 0 2 4 3 3 P3 0 1
P4 4 3
Safe or unsafe?

NEED = MAX - ALLOCATION


New Available = Pre_Available + Allocation
C
3
2
0
1
1
The system has the resourses as below:
A(11 instances), B(8), C(11)

Allocation Max Available


A B C A B C A B C
P0 1 1 2 11 8 10 11 8 10 P0
P1 3 0 0 5 2 1 12 9 12 P1
P2 3 1 1 9 3 2 P2
P3 1 1 1 3 3 4 P3
P4 1 1 3 6 4 9 P4
P5 1 2 2 1 3 2 P5
11 8 11
Is the system safe or unsafe?
Need
A B C
10 9 8
2 2 1
6 2 1
2 2 3
5 3 6
0 1 0

You might also like