Q1. Explain Resource Request Algorithm.
Ans. Following is the method of Resource Request Algorithm:
For process Pi
request=request vector for process Pi
processes Pi wants k instances of resource type Rj.
- If Requestj ≤ needi
go to step 2.
- If Requestj ≤ Available
go to step3
Pi must wait, because resources are not available.
- To allocate requested resources to Pi by modifying the state as follow:
Available = Available – Requestj
Allocation = Allocationj + Requestj
needi = needi – Requestj
If safe the resource are allocated to Pi.
If unsafe Pi must wait, and the old resource allocation state is restored.