Finish false then complexity om x n2 operations

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: Complexity: O(m x n2) operations. Deadlocks Example of Detection Algorithm Deadlocks Five processes P0 through P4; three resource types Five A (7 instances), B (2 instances), and C (6 instances). Snapshot at time T0: Snapshot Allocation Request Available Allocation Request Available ABC ABC ABC P0 0 1 0 000 000 P1 2 0 0 202 P2 3 0 3 000 P3 2 1 1 100 P4 0 0 2 002 Sequence <P0, P2, P3, P1, P4> will result in Finish[i] = will Finish true for all i. Example (Cont.) P2 requests an additional instance of type C. P0 P1 001 P3 100 P4 002 State of system? Deadlocks 201 P2 Request ABC 000 Can reclaim resources held by process P0, but insufficient Can but resources to fulfill other processes; requests. resources Deadlock exists, consisting of processes P1, P2, P3, and P4. Deadlock and Detection-Algorithm Usage When, and how often, to invoke depends on: How often a deadlock is likely to occur? How many processes will need to be rolled back? Deadlocks one for each disjoint cycle If detection algorithm is invoked arbitrarily, If there may be many cycles in the resource graph and so we would not be able to tell which of the many deadlocked processes “caused” the deadlock. “caused” Recovery from Deadlock: Process T...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online