Banker’s Algorithm
The Banker’s Algorithm is the classic approach to deadlock avoidance for resources with multiple units.
1. Assign a credit limit to each customer.
“maximum claim” must be stated/negotiated in advance
2. Reject any request that leads to a dangerous state.
A dangerous state is one in which a sudden request by any customer(s) for the full credit limit could lead to deadlock.
A recursive reduction procedure recognizes dangerous states.
3. In practice, this means the system must keep resource usage well below capacity to maintain a reserve surplus.