This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ithm
1. Let Work and Finish be vectors of length m and n,
Work = Available
Finish [i] = false for i = 0, 1, …, n- 1.
for 2. Find an i such that both:
(a) Finish [i] = false
(b) Needi ≤ Work
(b) Need Work
If no such i exists, go to step 4.
exists, 3. Work = Work + Allocationi
Finish[i] = true
go to step 2.
4. If Finish [i] == true for all i, then the system is in a
If Finish ==
Deadlocks Resource-Request Algorithm for
Request = request vector for process Pi. If Requesti [j]
= k then process Pi wants k instances of resource type Rj.
1. If Requesti ≤ Needi go to step 2. Otherwise, raise error
If Request Need
condition, since process has exceeded its maximum claim.
2. If Requesti ≤ Available, go to step 3. Otherwise Pi must wait,
If Request Available go
since resources are not available.
View Full Document
This document was uploaded on 10/07/2013.
- Fall '13