Available allocation an n x m matrix defines the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: n x m matrix defines the number of resources of each type currently allocated to each process. 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 Let Work Finish and n, respectively Initialize: (a) Work = Available (a) Work Available (b) For i = 1,2, …, n, if Allocationi ≠ 0, then For if Allocation Finish[i] = false;otherwise, Finish[i] = true. Finish[i] Finish[i] true 2. Find an index i such that both: Find such (a)Finish[i] == false == false (b) Requesti ≤ Work Work Deadlocks If no such i exists, go to step 4. If Detection Algorithm (Cont.) 3. Work = Work + Allocationi Work Allocation Finish[i] = true 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.

Ask a homework question - tutors are online