














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















Deadlock
A set of vertices V and a set of edges E
Restrain the ways a request can be made
1.Let Work and Finish be vectors of length m and n , respectively. Initialize: Work = Available Finish [ i ] = false for i = 1,2, …, n. 2.Find and i such that both: (a) Finish [ i ] = false (b) Needi ≤ Work If no such i exists, go to step 4.
Resource-Request Algorithm for Pi Requesti = request vector for process Pi. If Requesti [ j ] = k then process Pi wants k instances of resource type Rj. Algorithm:
Allocation Need Available A B C A B C A B C P 0 0 1 0 7 4 3 2 3 0 P 1 3 0 2 0 2 0 P 2 3 0 1 6 0 0 P 3 2 1 1 0 1 1 P 4 0 0 2 4 3 1
1.Let Work and Finish be vectors of length m and n , respectively Initialize: (a) Work = Available (b) For i = 1,2, …, n , if Allocationi ≠ 0, then Finish [i] = false; otherwise, Finish [i] = true. 2.Find an index i such that both: (a) Finish [ i ] == false (b) Requesti ≤ Work If no such i exists, go to step 4.