Deadlocks: Detection & Avoidance
(Chapter 32)
CS 4410 Operating Systems
The slides are the product of many rounds of teaching CS 4410 by Professors Agarwal, Bracy, George, Schneider, Sirer, and Van Renesse.
Deadlocks: Detection & Avoidance (Chapter 32) CS 4410 - - PowerPoint PPT Presentation
Deadlocks: Detection & Avoidance (Chapter 32) CS 4410 Operating Systems The slides are the product of many rounds of teaching CS 4410 by Professors Agarwal, Bracy, George, Schneider, Sirer, and Van Renesse. Dining Philosophers [Dijkstra
The slides are the product of many rounds of teaching CS 4410 by Professors Agarwal, Bracy, George, Schneider, Sirer, and Van Renesse.
2
1 2 3 4 1 4 3 2
3
4
5
6
7
8
9
Module:: foo() { lock.acquire(); doSomeStuff();
doOtherStuff(); lock.release(); } Module:: foo() { doSomeStuff();
doOtherStuff(); }
10
11
12
13
L1 L2 Ln
14
1 2 3 4 1 4 3 2
Forall i where 1 ≤ i ≤ n: Pi can be satisfied by Avail + resources held by P1 … Pi-1.
15
Current state is safe because a safe sequence exists: [p1, p0, p2]
What if p2 requests 1 drive? Grant or not?
16
17
18
19
Find node w/o outgoing edges Erase node Erase edges coming into it
20
21
22
23
24
25