OS_ch07_F07 - I.-C. Lin, Assistant Professor. Textbook:...

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

View Full Document Right Arrow Icon
I.-C. Lin, Assistant Professor. Textbook: Operating System Principles 7ed 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
hapter 7: Deadlocks Chapter 7: ± System Model ± Deadlock Characterization ± Methods for Handling Deadlocks ± Deadlock Prevention ± Deadlock Avoidance ± Deadlock Detection ± Recovery from Deadlock
Background image of page 2
hapter Objectives Chapter Objectives d l d i ti f d dl k hi h t t f ± 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 voiding deadlocks in a computer system 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
e Deadlock Problem The Deadlock Problem set of blocked processes each holding a resource and waiting ± 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 4
e Bridge Crossing Example The Bridge Crossing Example affic only in one direction. ± 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 5

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

View Full DocumentRight Arrow Icon
ystem Model System Model esource types ± Resource types R 1 , R 2 , . . ., R m ± E.g. CPU cycles, memory space, I/O devices ± Each resource type R i has W i instances. ± Each process utilizes a resource as follows: quest ± request ± use ± release
Background image of page 6
eadlock Characterization Deadlock Characterization eadlock can arise if four conditions hold simultaneously ± Deadlock can arise if four conditions hold simultaneously. ± Mutual exclusion ² only one process at a time can use a resource. ± Hold and wait process holding at least one resource is waiting to acquire additional resources ² a process holding at least one resource is waiting to acquire additional resources held by other processes. o preemption ± No preemption ² a resource can be released only voluntarily by the process holding it, after that process has completed its task. ± Circular wait ² there exists a set { P 0 , P 1 , , P 0 } of waiting processes ² P 0 Æ P 1 Æ Æ P 0
Background image of page 7

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

View Full DocumentRight Arrow Icon
source- llocation Graph Resource Allocation Graph set of vertices nd a set of edges ± A set of vertices V and a set of edges E ± V is partitioned into two types: ± P = { P 1 , P 2 , , P n }, the set consisting of all the processes in the system. ± R = { R 1 , R 2 , , R m }, the set consisting of all resource types in the system. ± request edge directed edge P 1 R j ± assignment edge directed edge R j P i
Background image of page 8
source- llocation Graph (Cont.) Resource Allocation Graph (Cont.) rocess ± Process ± Resource Type with 4 instances ± P i requests instance of R j P i R j holding an instance of P ± P i is holding an instance of R j i R j
Background image of page 9

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

View Full DocumentRight Arrow Icon
ample of a Resource Allocation Graph Example of a Resource Allocation Graph
Background image of page 10
source Allocation Graph With A Deadlock Resource Allocation Graph With A Deadlock
Background image of page 11

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

View Full DocumentRight Arrow Icon
ow about This One ? How about This One ?
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/29/2009 for the course INFO ENGI 9801 taught by Professor Wu during the Spring '09 term at 東京国際大学.

Page1 / 45

OS_ch07_F07 - I.-C. Lin, Assistant Professor. Textbook:...

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

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