Chapter 6 Deadlocks 6.1 - 6.3 Resources Introduction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13- 6006639.

Slides:



Advertisements
Similar presentations
1 Concurrency: Deadlock and Starvation Chapter 6.
Advertisements

Deadlock Prevention, Avoidance, and Detection
Concurrency: Deadlock and Starvation Chapter 6. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate.
Deadlock Prevention, Avoidance, and Detection.  The Deadlock problem The Deadlock problem  Conditions for deadlocks Conditions for deadlocks  Graph-theoretic.
Concurrency: Deadlock and Starvation Chapter 6. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate.
Synchronization Algorithms and Concurrent Programming
DEADLOCK. Contents  Principles of deadlock  Deadlock prevention  Deadlock detection.
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Operating Systems COMP 4850/CISG 5550 Deadlock Avoidance Dr. James Money.
Chapter 3 Deadlocks TOPICS Resource Deadlocks The ostrich algorithm
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 6 Deadlocks Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All.
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.3. The ostrich algorithm 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance.
Tanenbaum Ch 6 Silberschatz Ch 7
With slides from C. Griwodz, K. Li, A. Tanenbaum and M. van Steen
Deadlock Chapter 3 R1 R2 P2P1 Allocated Requested.
Deadlocks Tore Larsen With slides from T. Plagemann, C. Griwodz, K. Li, A. Tanenbaum and M. van Steen.
Deadlocks. 2 System Model There are non-shared computer resources –Maybe more than one instance –Printers, Semaphores, Tape drives, CPU Processes need.
Modified from Silberschatz, Galvin and Gagne Lecture 13 Chapter 7: Deadlocks.
Deadlock CSCI 444/544 Operating Systems Fall 2008.
The ‘deadlock’ conditions Reviewing some key points concerning the potential for ‘deadlock’ in an operating system.
Chapter 3 Deadlocks 3.1. Resource 3.2. Introduction to deadlocks
CPSC 4650 Operating Systems Chapter 6 Deadlock and Starvation
Chapter 7 – Deadlock and Indefinite Postponement
Deadlock Detection with One Resource of Each Type (1)
Chapter 7: Deadlocks. 7.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Bridge Crossing Example Traffic only in one direction. Each section.
1 Processes, Threads, Race Conditions & Deadlocks Operating Systems Review.
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.3. The ostrich algorithm 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance.
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance 3.6. Deadlock prevention.
1 Deadlocks 2 Resources Examples of computer resources –printers –tape drives –tables Processes need access to resources in reasonable order Suppose.
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.3. The ostrich algorithm 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance.
1 Deadlocks Chapter 3. 2 Resources Examples of computer resources –printers –tape drives –tables Processes need access to resources in reasonable order.
Operating Systems 软件学院 高海昌 Operating Systems Gao Haichang, Software School, Xidian University 22 Contents  1. Introduction** 
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.3. The ostrich algorithm 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance.
Operating Systems (OS)
1 MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 6 Deadlocks Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 6 Deadlocks Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All.
Deadlock Operating Systems: Internals and Design Principles.
Deadlock cs550 Operating Systems David Monismith.
Deadlocks. Deadlock handling Deadlock prevention Deadlock avoidance Deadlock detection Deadlock recovery.
CSC 322 Operating Systems Concepts Lecture - 28: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
CS333 Intro to Operating Systems Jonathan Walpole.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings.
Operating Systems COMP 4850/CISG 5550 Deadlocks Dr. James Money.
Deadlock. Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock.
Deadlocks 12/02/2015. What is a deadlock ? System has a finite set of resources. Resource can have one or more instances. Processes compete for resources.
Deadlocks References –text: Tanenbaum ch.3. Deadly Embrace Deadlock definition –A set of process is dead locked if each process in the set is waiting.
Deadlocks CPE Operating Systems
Deadlocks Chapter 6 Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.
Sistem Operasi IKH311 Deadlock. 2 Resources Examples of computer resources printers tape drives tables Processes need access to resources in reasonable.
Deadlocks Lots of resources can only be used by one process at a time. Exclusive access is needed. Suppose process A needs R1 + R2 and B needs R1 + R2.
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Deadlocks References text: Tanenbaum ch.3.
Lecture 18: Deadlock: Conditions, Detection and Avoidance (cont.)
Lecture 19: Deadlock: Conditions, Detection and Avoidance
Chapter 7: Deadlocks.
Chapter 7: Deadlocks.
Deadlocks References text: Tanenbaum ch.3.
Deadlocks Definition A set of processes is in a Deadlock state when every process in the set is waiting for an event that can only be caused by another.
DPNM Lab. Dept. of CSE, POSTECH
Review: Readers-Writers Problem
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Chapter 3 Deadlocks 3.1. Resource 3.2. Introduction to deadlocks
DEADLOCK.
Lecture 19: Deadlock: Conditions, Detection and Avoidance
Chapter 3 Deadlocks 3.1. Resource 3.2. Introduction to deadlocks
Introduction to Deadlocks
Chapter 3 Deadlocks 3.1. Resource 3.2. Introduction to deadlocks
Deadlocks References text: Tanenbaum ch.3.
Chapter 8: Deadlocks Deadlock Characterization
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Presentation transcript:

Chapter 6 Deadlocks Resources Introduction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Preemptable and Nonpreemptable Resources Sequence of events required to use a resource: 1. Request the resource. 2. Use the resource. 3. Release the resource. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure 6-1. Using a semaphore to protect resources. (a) One resource. (b) Two resources. Resource Acquisition (1) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure 6-2. (a) Deadlock-free code. Resource Acquisition (2) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure 6-2. (b) Code with a potential deadlock. Resource Acquisition (3) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Introduction To Deadlocks Deadlock can be defined formally as follows: A set of processes is deadlocked if each process in the set is waiting for an event that only another process in the set can cause. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Conditions for Resource Deadlocks 1. Mutual exclusion condition 2. Hold and wait condition. 3. No preemption condition. 4. Circular wait condition. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure 6-3. Resource allocation graphs. (a) Holding a resource. (b) Requesting a resource. (c) Deadlock. Deadlock Modeling (1) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure 6-4. An example of how deadlock occurs and how it can be avoided. Deadlock Modeling (2) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure 6-4. An example of how deadlock occurs and how it can be avoided. Deadlock Modeling (3) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Figure 6-4. An example of how deadlock occurs and how it can be avoided. Deadlock Modeling (4) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

Deadlock Modeling (5) Strategies for dealing with deadlocks: 1. Just ignore the problem. 2. Detection and recovery. Let deadlocks occur, detect them, take action. 3. Dynamic avoidance by careful resource allocation. 4. Prevention, by structurally negating one of the four required conditions. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved