Avoiding Deadlock: Bankers Algorithm

Resources are analogous to the units of money that a bank has. Not enough units to meet all possible needs at once, but if the units were passed out in a particular order then every request can be satisfied (but it may take some time).

Initial configuration

NameUsedMaximum
Andy06
Barbara05
Marvin04
Suzanne07
Available: 10

After some resources have been allocated

NameUsedMaximum
Andy16
Barbara15
Marvin24
Suzanne47
Available: 2
NameUsedMaximum
Andy16
Barbara25
Marvin24
Suzanne47
Available: 1

Figures based on ones appearing on page 176 of Operating Systems: Design and Implementation, 2nd Edition by Andrew S. Tanenbaum and Albert S. Woodhull, Prentice Hall, 1997.