The Banker’s Algorithm
Handles multiple instances for resource types.
n = number of processes; m = number of resource types;
Data Structures:
- Available: vector [1..m], Available[ j ] - the number of instances currently available for resource j.
- Max: matrix[1..n, 1..m], Max[ i, j ] - the maximum number of instances of resource j that process i can request at any one time.
- Allocation: matrix[1..n, 1..m] - process i currently holds Allocation[ i, j ] instances of resource j.
- Need: matrix[1..n, 1..m] - process i may need additional Need[ i, j ] instances of resource j.
Need[ i, j ] = Max[ i, j ] - Allocation[ i, j ]