+ All Categories
Home > Technology > Deadlock

Deadlock

Date post: 25-May-2015
Category:
Upload: bhavanatmithun
View: 332 times
Download: 1 times
Share this document with a friend
Description:
computer networks
Popular Tags:
13
Transcript
Page 1: Deadlock
Page 2: Deadlock
Page 3: Deadlock
Page 4: Deadlock
Page 5: Deadlock
Page 6: Deadlock

Deadlock Detection

With one resource of each type• Construct a resource graph– If this graph contains one or more cycles, deadlock

exists– If no cycles exist, system is not deadlocked.

Page 7: Deadlock

Operating Systems: Deadlock 7

Resource Allocation Modelling using Graphs

Nodes : resource process

Arcs : resource requested :

resource allocated :

Page 8: Deadlock

Operating Systems: Deadlock 8

• Methods of Detection - single resources– search for loops in resource allocation graph

Page 9: Deadlock

Operating Systems: Deadlock 9

• Depth-first Graph search– use a list of nodes L and progressively mark arcs

1. For each node N in the graph, perform steps 2-6 with N as starting node

2. Initialise L to empty and designate all arcs as unmarked3. Add current node to L

• check if node appears twice in L• if so, graph contains a cycle - algorithm terminates

4. From given node, if there are any unmarked outgoing arcs, goto 5else goto 6

5. Pick an unmarked outgoing arc and mark it• follow it to new current node and goto 3

6. Have reached a dead end• go back to previous node and goto 4• if this node is the initial node, graph does not contain cycles and

algorithm terminates

Page 10: Deadlock
Page 11: Deadlock
Page 12: Deadlock

Recovery

Page 13: Deadlock

Recommended