Banker’s Algorithm - Resource Request
Requesti - request vector - the number of additional instances for each resource type process i requests at this time.
1. If not (Requesti ? Needi) raise an error - process i tries to get more resources than what it declared.
2. If not (Requesti ? Available) process i must wait - no sufficient resources at this time.
3. Tentatively allocate the requested resources to process i:
Available := Available - Requesti
Allocationi := Allocationi + Requesti
Needi := Needi - Requesti
4. Check safety of state. If safe, the resources are allocated.
If not safe then cancel the tentative allocation