A. Berrached::cms::uhd

Slides:



Advertisements
Similar presentations
Chapter 7: Deadlocks.
Advertisements

Chapter 7: Deadlocks Adapted by Donghui Zhang from the original version by Silberschatz et al.
Chapter 7: Deadlocks.
7.5 Deadlock Avoidance The algorithm is simply to ensure that the system will always remain in safe state. Therefore, if a process requests a resource.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 7: Deadlocks.
7.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 7: Deadlocks.
Deadlocks CS 3100 Deadlocks1. The Deadlock Problem A set of blocked processes each holding a resource and waiting to acquire a resource held by another.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 8: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks.
Chapter 7: Deadlocks. 7.2 Chapter Objectives To develop a description of deadlocks, which prevent sets of concurrent processes from completing their tasks.
1 Chapter 7: Deadlock. 2 The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance.
Chapter 7: Deadlocks. 7.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 14, 2005 Chapter 7: Deadlocks The Deadlock.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 7: Deadlocks.
Deadlocks Gordon College Stephen Brinton. Deadlock Overview The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks.
What we will cover…  The Deadlock Problem  System Model  Deadlock Characterization  Methods for Handling Deadlocks  Deadlock Prevention  Deadlock.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 8: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks.
Chapter 7 Deadlocks. 7.2 Modified By Dr. Khaled Wassif Operating System Concepts – 7 th Edition Silberschatz, Galvin and Gagne ©2005 Chapter 7: Deadlocks.
Cosc 4740 Chapter 6, Part 4 Deadlocks. The Deadlock Problem A set of blocked processes each holding a resource and waiting to acquire a resource held.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-6 Deadlocks Department of Computer Science and Software Engineering.
Chapter 7: Deadlocks. 7.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 7: Deadlocks.
Chapter 7: Deadlocks. 7.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock.
 The Deadlock Problem  System Model  Deadlock Characterization  Methods for Handling Deadlocks  Deadlock Prevention  Deadlock Avoidance  Deadlock.
Chapter 7: Deadlocks. 7.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 7: Deadlocks System Model Deadlock Characterization Methods.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 7: Deadlocks.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 7 Operating Systems.
Operating Systems Unit VI Deadlocks and Protection Department of Computer Science Engineering and Information Technology.
Chapter 7: Deadlocks. 7.2CSCI 380 – Operating Systems Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling.
7.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization.
Chapter 7: Deadlocks. 7.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock.
CS307 Operating Systems Deadlocks Fan Wu Department of Computer Science and Engineering Shanghai Jiao Tong University Spring 2012.
Chap 7 Deadlocks. Chapter Objectives To develop a description of deadlocks, which prevent sets of concurrent processes from completing their tasks To.
Deadlocks - System Model - Deadlock characterization - Methods for handling deadlocks - Deadlock prevention,avoidance - Deadlock detection and recovery.
7.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 7: Deadlocks.
Chapter 7: Deadlocks. 7.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock.
Chapter 7: Deadlocks. 7.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 14, 2005 Chapter 7: Deadlocks The Deadlock.
Chapter 7: Deadlocks. The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 7: Deadlocks.
Thursday, February 23, 2012 Chapter 6 homework questions?
Chapter 7: Deadlocks.
CSSE 332 Operating Systems Rose-Hulman Institute of Technology
Chapter 7: Deadlocks.
ICS Principles of Operating Systems
G.Anuradha Ref:- Galvin
Chapter 7: Deadlocks.
Operating System: DEADLOCKS
Chapter 7 Deadlocks.
Process Deadlocks.
Chapter 7: Deadlocks.
Deadlock B.Ramamurthy CSE421 1/11/2019 B.Ramamurthy.
Lecture 6: Deadlocks, Deadlock Risk Management
G.Anuradha Ref:- Galvin
Chapter 7: Deadlocks.
Outline Deadlocks, dead lock prevention, avoidance.
Deadlock Prevention Restrain the ways request can be made.
CSc 552 Advanced Unix Process deadlock deadlock prevention
Deadlocks Session - 14.
Lecture 29 Syed Mansoor Sarwar
Deadlock B.Ramamurthy CSE421 2/23/2019 B.Ramamurthy.
Deadlocks Session - 13.
Chapter 7: Deadlocks.
Deadlock B.Ramamurthy CSE421 4/23/2019 B.Ramamurthy.
Deadlock B.Ramamurthy CSE421 5/1/2019 B.Ramamurthy.
Chapter 7: Deadlocks.
Chapter 7: Deadlocks.
Chapter 8: Deadlocks Deadlock Characterization
Deadlock B.Ramamurthy CSE421 8/28/2019 B.Ramamurthy.
Deadlock B.Ramamurthy CSE421 9/3/2019 B.Ramamurthy.
Presentation transcript:

A. Berrached::cms::uhd Deadlock Chapter 10 10/2/2019 A. Berrached::cms::uhd

A. Berrached::cms::uhd Deadlock System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection & Recovery 10/2/2019 A. Berrached::cms::uhd

A. Berrached::cms::uhd The Deadlock Problem A state where a set of processes are blocked each holding a resource and waiting to acquire a resource held by another process in the set. Example: Semaphores A and B initialized to 1 P0: P1: wait(A); wait(B); wait(B); wait(A); …. ….. 10/2/2019 A. Berrached::cms::uhd

A. Berrached::cms::uhd Process 1 Process 2 Process 3 …. …. …... Request (resource1); Request (resource2); Request (resource3); /*holding res 1 */ /*holding res 2 */ /*holding res 3 */ ….. ….. ….. Request(resource2) Request(resource3); Request(resource1); …. ….. ….. 10/2/2019 A. Berrached::cms::uhd

A. Berrached::cms::uhd System Model 10/2/2019 A. Berrached::cms::uhd

Deadlock Characterization 10/2/2019 A. Berrached::cms::uhd

Resource Allocation Graph 10/2/2019 A. Berrached::cms::uhd

Resource Allocation Graph (cont.) 10/2/2019 A. Berrached::cms::uhd

Example of a graph with no cycles 10/2/2019 A. Berrached::cms::uhd

Example of a graph with a cycle 10/2/2019 A. Berrached::cms::uhd

A. Berrached::cms::uhd Basic Facts 10/2/2019 A. Berrached::cms::uhd

Methods for handling deadlocks 10/2/2019 A. Berrached::cms::uhd

A. Berrached::cms::uhd Deadlock Prevention 10/2/2019 A. Berrached::cms::uhd

Deadlock Prevention (cont.) 10/2/2019 A. Berrached::cms::uhd

A. Berrached::cms::uhd Deadlock Avoidance 10/2/2019 A. Berrached::cms::uhd

A. Berrached::cms::uhd Safe State 10/2/2019 A. Berrached::cms::uhd

A. Berrached::cms::uhd Basic Facts 10/2/2019 A. Berrached::cms::uhd

A. Berrached::cms::uhd Banker's Algorithm 10/2/2019 A. Berrached::cms::uhd

Data Structures for the Banker's Algorithm 10/2/2019 A. Berrached::cms::uhd

A. Berrached::cms::uhd Safety Algorithm Else if no i can be found where Finish[i]=flase and Needi <= Work , then the system is in an unsafe state 10/2/2019 A. Berrached::cms::uhd

Resource Request Algorithm for Process Pi 10/2/2019 A. Berrached::cms::uhd

Example of Banker's Algorithm 10/2/2019 A. Berrached::cms::uhd

A. Berrached::cms::uhd Example (cont.) 10/2/2019 A. Berrached::cms::uhd

Example (cont.): P1 requests (1,0,2) 10/2/2019 A. Berrached::cms::uhd

A. Berrached::cms::uhd Deadlock Detection Allow system to enter deadlock state Detection Algorithm Recovery scheme 10/2/2019 A. Berrached::cms::uhd

Single Instance of Each Resource Type Maintain a resource allocation graph Periodically invoke algorithm that searches for cycles in the graph If there is a cycle ==> set of processes in cycle are in deadlock 10/2/2019 A. Berrached::cms::uhd

A. Berrached::cms::uhd Deadlock Detection 10/2/2019 A. Berrached::cms::uhd

RAG Reduction Algorithm Given the resource allocation graph of the system at the current state. Determine if the system is in deadlock. 1. if a process is not blocked (i.e. if all resources the process is requesting to finish its task are available), then reduce graph by that process: remove the process node from the graph, return all its allocated resources, and remove all arrows from and to that process. 10/2/2019 A. Berrached::cms::uhd

Deadlock Detection--RAG Reduction 10/2/2019 A. Berrached::cms::uhd

Deadlock Detection--RAG Reduction 2. Repeat step 1 until all process node are removed or the graph can not be reduced any further. If a graph can be reduce by all its processes, then there is no deadlock If a graph can NOT be completely reduced by all its processes then the "irreducible" processes constitute the set of deadlocked processes. 10/2/2019 A. Berrached::cms::uhd

A. Berrached::cms::uhd 10/2/2019 A. Berrached::cms::uhd

Deadlock Detection-- Usage 10/2/2019 A. Berrached::cms::uhd

Recovery From Deadlock 10/2/2019 A. Berrached::cms::uhd

Recovery From Deadlock 10/2/2019 A. Berrached::cms::uhd