This preview shows page 1. Sign up to view the full content.
Unformatted text preview: n x m matrix defines the number of
resources of each type currently allocated to each
process. Request: An n x m matrix indicates the current request
of each process. If Request [ij] = k, then process Pi is
requesting k more instances of resource type. Rj.
requesting Deadlocks Detection Algorithm
1. Let Work and Finish be vectors of length m
and n, respectively Initialize:
(a) Work = Available
(a) Work Available
(b) For i = 1,2, …, n, if Allocationi ≠ 0, then
Finish[i] = false;otherwise, Finish[i] = true.
Finish[i] true 2. Find an index i such that both:
(a)Finish[i] == false
(b) Requesti ≤ Work
Deadlocks If no such i exists, go to step 4.
If Detection Algorithm (Cont.)
3. Work = Work + Allocationi
Finish[i] = true
go to step 2.
4. If Finish[i] == false, for some i, 1 ≤ i ≤ n,
If Finish ==
then the system is in deadlock state. Moreover,
if Finish[i] == false, then Pi is deadlocked.
Finish == false then...
View Full Document
This document was uploaded on 10/07/2013.
- Fall '13