Deadlocks safety algorithm 1 let work and finish be

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: ithm 1. Let Work and Finish be vectors of length m and n, Let Work Finish respectively. Initialize: respectively. Work = Available Work Available Finish [i] = false for i = 0, 1, …, n- 1. Finish for 2. Find an i such that both: Find (a) Finish [i] = false Finish false (b) Needi ≤ Work (b) Need Work If no such i exists, go to step 4. If exists, 3. Work = Work + Allocationi Allocation Finish[i] = true go to step 2. 4. If Finish [i] == true for all i, then the system is in a If Finish == then safe state. safe Deadlocks Resource-Request Algorithm for Resource-Request Process Pi Request = request vector for process Pi. If Requesti [j] Request If Request = 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. condition, 2. If Requesti ≤ Available, go to step 3. Otherwise Pi must wait, If Request Available go since resources are not available. since 3. Prete...
View Full Document

This document was uploaded on 10/07/2013.

Ask a homework question - tutors are online