Chapter_7

Chapter_7 - Chapter 7 Deadlocks s s s s The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks q q Deadlock

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

View Full Document Right Arrow Icon
7.1 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 and Resolution Combined approach for deadlock handling Recovery from Deadlock
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 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, detecting and avoiding deadlocks in a computer system.
Background image of page 2
7.3 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Background Background Legislation passed in Kansas early in the 20 th century “When two trains approach each other at a crossing, both shall come to a full stop and neither shall start up again until the other has gone.” In a multiprogramming environment several processes compete for a given number of resources. A Process requests for resources; if the resources are not available at that time the process remains blocked until it acquires the requested resource. How about this law: “All vehicles approaching a 4-way stop sign shall come to a full stop. The vehicle that reached the stop sign first has the right to cross the intersection first.”
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 The Deadlock Problem The Deadlock Problem Deadlock State : There exists 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 only 2 tape drives. There are two processes P 1 and P 2 in the system. P 1 and P 2 each hold one tape drive and each needs another tape drive. 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
7.5 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Bridge Crossing Example Bridge Crossing Example On the narrow bridge, traffic is allowed only in one direction at any time. 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
7.6 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Traffic Deadlock Traffic Deadlock
Background image of page 6
Silberschatz, Galvin and Gagne ©2005 Operating System Concepts System Model System Model Resource types R 1 , R 2 , . . ., R m CPU cycles, memory space, I/O devices Each resource type R i has W i instances. Each process utilizes a resource as follows:
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 document was uploaded on 12/14/2010.

Page1 / 44

Chapter_7 - Chapter 7 Deadlocks s s s s The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks q q Deadlock

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