Deadlocks in Distributed Systems Ryan Clemens, Thomas Levy, Daniel Salloum, Tagore Kolluru, Mike DeMauro.

Slides:



Advertisements
Similar presentations
Chapter 7: Deadlocks.
Advertisements

1 Deadlock Deadlock is a situation where a process or a set of processes is blocked on an event that never occurs Processes while holding some resources.
Deadlock Prevention, Avoidance, and Detection
1 Distributed Deadlock Fall DS Deadlock Topics Prevention –Too expensive in time and network traffic in a distributed system Avoidance.
Deadlock and Starvation
Handling Deadlocks n definition, wait-for graphs n fundamental causes of deadlocks n resource allocation graphs and conditions for deadlock existence n.
Operating Systems Lecture Notes Deadlocks Matthew Dailey Some material © Silberschatz, Galvin, and Gagne, 2002.
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.
6. Deadlocks 6.1 Deadlocks with Reusable and Consumable Resources
Chapter 7: Deadlocks.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Computer Systems Principles Deadlock Emery Berger and Mark Corner University of Massachusetts.
Chapter 6 Concurrency: Deadlock and Starvation
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 7: Deadlocks.
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.
CS 450 OPERATING SYSTEMS DEADLOCKS Manju Muralidharan Priya.
The ‘deadlock’ conditions Reviewing some key points concerning the potential for ‘deadlock’ in an operating system.
CPSC 4650 Operating Systems Chapter 6 Deadlock and Starvation
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Deadlock and Starvation Deadlock – two or more processes are waiting indefinitely for.
Deadlocks Gordon College Stephen Brinton. Deadlock Overview The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks.
Distributed process management: Distributed deadlock
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.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 7: Deadlocks.
Chapter 7 – Deadlock (Pgs 283 – 306). Overview  When a set of processes is prevented from completing because each is preventing the other from accessing.
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.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 7: Deadlocks.
Distributed and hierarchical deadlock detection, deadlock resolution
CS6502 Operating Systems - Dr. J. Garrido Deadlock – Part 2 (Lecture 7a) CS5002 Operating Systems Dr. Jose M. Garrido.
Chapter 7: Deadlocks. 7.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock.
This Time - Deadlock Definition Conditions for deadlocks
 The Deadlock Problem  System Model  Deadlock Characterization  Methods for Handling Deadlocks  Deadlock Prevention  Deadlock Avoidance  Deadlock.
Dr. Kalpakis CMSC 421, Operating Systems Deadlocks.
DEADLOCK DETECTION ALGORITHMS IN DISTRIBUTED SYSTEMS
Chapter 7: Deadlocks. 7.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 7: Deadlocks System Model Deadlock Characterization Methods.
Styresystemer og Multiprogrammering Block 3, 2005 Deadlocks Robert Glück.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 7 Operating Systems.
Chapter 8 Deadlocks. Objective System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection.
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.
Silberschatz, Galvin and Gagne ©2009 Edited by Khoury, 2015 Operating System Concepts – 9 th Edition, Chapter 7: Deadlocks.
Informationsteknologi Monday, October 1, 2007Computer Systems/Operating Systems - Class 111 Today’s class Deadlock.
7.1 CSE Department MAITSandeep Tayal 7: Deadlocks 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.
Chapter 7: Deadlocks.
OPERATING SYSTEM CONCEPTS AND PRACTISE
Process Management Deadlocks.
Synchronization: Distributed Deadlock Detection
ITEC 202 Operating Systems
G.Anuradha Ref:- Galvin
Chapter 7 Deadlocks.
Process Deadlocks.
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.
Deadlock B.Ramamurthy CSE421 1/11/2019 B.Ramamurthy.
DEADLOCK.
Deadlock B.Ramamurthy CSE421 4/23/2019 B.Ramamurthy.
Distributed Deadlock Detection
Deadlock B.Ramamurthy CSE421 5/1/2019 B.Ramamurthy.
Chapter 7: Deadlocks.
Deadlock B.Ramamurthy CSE421 8/28/2019 B.Ramamurthy.
Deadlock B.Ramamurthy CSE421 9/3/2019 B.Ramamurthy.
Presentation transcript:

Deadlocks in Distributed Systems Ryan Clemens, Thomas Levy, Daniel Salloum, Tagore Kolluru, Mike DeMauro

Outline Distributed systems Deadlock basics Strategies Algorithms Simulation

What is a distributed system? A collection of sites which communicate via message passing. – Centralized – Decentralized

What is a deadlock? A deadlock occurs when all elements of a set, comprised of multiple processes, request a resource which is held by another process in the set. – In distributed systems, a deadlock may arise when waiting for messages in addition to resources.

Conditions for a Deadlock Necessary – Mutual Exclusion – Hold and Wait – No Preemption Sufficient – Circular Wait

Mutual Exclusion When one process enters its critical state while accessing a resource no other process can enter their critical state to access the same resource. – Without this, multiple processes could access the same resource, which would mean they would not have to wait, which would prevent the deadlock. This would cause data corruption. – When messages are the resources, mutual exclusion is guaranteed.

Hold and Wait Occurs when a process gathers and retains certain resources, but is still awaiting other resources before it can continue execution. -Without this, there could be no deadlocks because if process A is waiting on a resource held by process B, process B is guaranteed to be able to proceed. -This limits what we can program.

No Preemption No process can take resources held by another process. – If preemption is allowed and mutual exclusion is maintained, once a resource has been preempted, the process which previously had the resource needs to be placed in a state where it no longer has it. This may mean killing the process. – If there is no mutual exclusion, there can be no concept of preemption.

Circular Wait A set of nodes with transitive relationship are in circular wait if the dependency chain of a node leads back to itself. – Without this, the dependency graph becomes a directed acyclic graph, which will have a sink which can continue. The standard way of preventing circular wait is to create a partial ordering of the resources and only allow a process to request resources which are higher in the ordering than the current highest held. – This is inconvenient if the resources needed by a process are not known beforehand.

Prevention Prevention is preventing a process from requesting a resource which would lead to a deadlock. A standard method of prevention is to force processes to acquire all their required resources before execution. Another method is to remove one of the four conditions for deadlocks.

Avoidance Avoidance is when a resource is granted to a process only when the resulting state is safe. – A safe state if there is an execution sequence which does not lead to a deadlock. Banker’s algorithm: This algorithm needs to know the current amount of available resources the system has free, the amount of resources each process has, and an upper bound on the amount of resources each process will hold during its execution. It will only grant a request for resources to a process if it leaves the system with enough resources to fulfill the biggest possible request for resources for at least one process.

Detection No resource checking done in advance State is stored in some fashion Periodically checks state for deadlocks

Graphs a) Resource Allocation Graph (Transaction Wait For) b) Wait For Graph (WFG)

Recovery Kill Member of Detected Deadlock – Random Kill – Priority Kill – Kill Youngest Time-out approach

Distributed Issues False (Phantom) Deadlock Detection

Algorithm Considerations Message Passing – Traffic – Length Resolution Efficiency

Resource Models Single-resource AND OR AND-OR

Detection Algorithm Classes Path-Pushing Edge-Chasing (probe based) Diffusing Computations Global State Detection

Selected Algorithms Obermarck’s – Path-Pushing – AND model – Obsoleted for inaccurate WFG Hermann and Chandy’s – AND-OR – Diffusing computation Bracha and Toueg’s – AND-OR – Global state detection

Algorithms Mitchell and Merritt’s – Single-Resource – Edge chasing – Benefits Simple Only one cycle detects deadlock Not always phantom deadlocks – Complexity – O(s(s-1)/2)

Chandy and Misra’s Algorithm Multiple Resource Diffusing computation AND Model Complexity: O(N(N-1))

Algorithms Probe-based Algorithms – Chandy-Mirsa-Haas – Roesler Hierarchical Algorithms – Ho-Ramamoorthy

Algorithms (cont) Online deadlock detection (Isloor-Marsland) – Immediate deadlock detection

Difficulty of Proof TWF graphs can form in many ways, which makes it difficult to study all situations Deadlocks are sensitive to the timing of requests In distributed systems, message latency is unpredictable and there is no global memory

Requirements for algorithm correctness At least one process can proceed No process will be restarted an indefinite number of times

Simulation Partial reversion of process instead of killing it Uses a WFG of the entire system to detect deadlocks This algorithm honors mutual exclusion and implements preemption. Causes more data corruption than simply killing the youngest process. – A solution to this is programmers writing their code anticipating the possibility of a reversion.

References Knapp, Edgar. Deadlock detection in distributed databases, ACM Computing Surveys, Volume 19 Issue 4, Dec Natalija Krivokapić, Alfons Kemper, Ehud Gudes. Deadlock detection in distributed database systems: a new algorithm and a comparative performance analysis. The VLDB Journal — The International Journal on Very Large Data Bases, Volume 8 Issue 2, October 1999 – doi: /s /s – URL: Singhal, M.;, "Deadlock detection in distributed systems," Computer, vol.22, no.11, pp.37-48, Nov 1989 – doi: / URL: