ch07 - Chapter 7 Deadlocks Chapter Chapter 7 Deadlocks s...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 7: Deadlocks Chapter 7: Deadlocks
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
7.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 7: Deadlocks Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock
Background image of page 2
7.3 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter Objectives Chapter Objectives To develop a description of deadlocks, which prevent sets of concurrent processes from completing their tasks To present a number of different methods for preventing or avoiding deadlocks in a computer system.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
7.4 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts System Model System Model A system consists of a finite number of resources to be distributed among a set of competing processes Resource types R 1 , R 2 , . . ., R m CPU cycles, memory space, I/O devices, printers, files Each resource type R i has W i instances. Each process utilizes a resource as follows: Request : If the request cannot be granted immediately, then the requesting process must wait until it can acquire it Use : The process can operate on the resource Release : The process releases the resource A set of processes is in a deadlock state when every process in the set is waiting for an event that can be caused only by another process in the set
Background image of page 4
7.5 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts The Deadlock Problem The Deadlock Problem A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set. Example System has 2 tape drives. P 1 and P 2 each hold one tape drive and each needs another one. Example semaphores A and B , initialized to 1 P 0 P 1 wait (A); wait(B) wait (B); wait(A)
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
7.6 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Bridge Crossing Example Bridge Crossing Example Traffic only in one direction. Each section of a bridge can be viewed as a resource. If a deadlock occurs, it can be resolved if one car backs up (preempt resources and rollback). Several cars may have to be backed up if a deadlock occurs. Starvation is possible.
Background image of page 6
7.7 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Deadlock Characterization Deadlock Characterization Mutual exclusion: only one process at a time can use a resource. Hold and wait: a process holding at least one resource is waiting to acquire additional resources held by other processes. No preemption: a resource can be released only voluntarily by the process holding it, after that process has completed its task. Circular wait:
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/01/2011 for the course CSSE 250 taught by Professor Dr.yingwuzhu during the Spring '11 term at UH Clear Lake.

Page1 / 42

ch07 - Chapter 7 Deadlocks Chapter Chapter 7 Deadlocks s...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online