Banker's Algorithm 64
Banker's Algorithm 64
SUBMITTED TO:
PROF.USMAN SAIF
PRESENTED BY:
MUHAMMAD UMAIR
REG NO.G1F16BSCS0100
INTRODUCTION
The system is said to be in a safe state if there exists a sequence of other valid system states that leads
to the successful completion of all processes.
• If request results in an unsafe state, the request is denied and the process continues to hold resources
it has until such time as it's request can be met.
• Let ‘n’ be the number of processes in the system and ‘m’ be the number of resources
types.
• Available(m)
• Max (n x m)
• Allocated (n x m)
• Need (n x m)
EXAMPLE
• Total=(6,3,5,2)
• Allocated=(4,1,3,2)
Allocation Matrix
Processes Speakers Scanners Printers Hard Disks
P1 2 0 1 0
P2 0 1 1 1
P3 1 0 0 1
P4 1 0 1 0
Need Matrix
Processes Speakers Scanners Printers Hard Disks
P1 2 0 2 1
P2 0 1 1 1
P3 0 1 1 0
P4 3 0 2 0
(1,0,0,1) Allocation(P3)
(2,0,1,0) Allocation(P1)
(0,1,1,1) Allocation(P2)
(1,0,1,0) Allocation(P4)