Chapter 7 –System Model – typical assumptions underlying the study of distributed deadlock detection Only reusable resources, only exclusive access, single.

Slides:



Advertisements
Similar presentations
Distributed Deadlocks
Advertisements

CS3771 Today: deadlock detection and election algorithms  Previous class Event ordering in distributed systems Various approaches for Mutual Exclusion.
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.
Handling Deadlocks n definition, wait-for graphs n fundamental causes of deadlocks n resource allocation graphs and conditions for deadlock existence n.
Deadlock Prevention, Avoidance, and Detection.  The Deadlock problem The Deadlock problem  Conditions for deadlocks Conditions for deadlocks  Graph-theoretic.
Deadlocks in Distributed Systems Ryan Clemens, Thomas Levy, Daniel Salloum, Tagore Kolluru, Mike DeMauro.
Distributed Process Management
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.
CompSci 143aSpring, Deadlocks 6.1 Deadlocks with Reusable and Consumable Resources 6.2 Approaches to the Deadlock Problem 6.3 A System Model.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 8: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
1 Chapter 7: Deadlock. 2 The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance.
Chapter 18: Distributed Coordination (Chapter 18.1 – 18.5)
Distributed process management: Distributed deadlock
Distributed Systems Fall 2009 Distributed transactions.
Deadlocks – An Introduction
Distributed Transactions
Diffusing Computation. Using Spanning Tree Construction for Solving Leader Election Root is the leader In the presence of faults, –There may be multiple.
1 Distributed Process Management Chapter Distributed Global States Operating system cannot know the current state of all process in the distributed.
Presenter: Long Ma Advisor: Dr. Zhang 4.5 DISTRIBUTED MUTUAL EXCLUSION.
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.
CHAPTER 8: DEADLOCKS System Model Deadlock Characterization
Distributed Deadlock Detection
Distributed and hierarchical deadlock detection, deadlock resolution
DEADLOCK DETECTION ALGORITHMS IN DISTRIBUTED SYSTEMS
Styresystemer og Multiprogrammering Block 3, 2005 Deadlocks Robert Glück.
Operating Systems Unit VI Deadlocks and Protection Department of Computer Science Engineering and Information Technology.
1 Chapter 11 Global Properties (Distributed Termination)
Ch 3 –What is a deadlock ? –Conditions Hold and Wait Mutual Exclusion Non Preemption Circular Wait –Deadlock Models Single Unit Request AND Request OR.
CSC 8420 Advanced Operating Systems Georgia State University Yi Pan Transactions are communications with ACID property: Atomicity: all or nothing Consistency:
DEADLOCKS IN DISTRIBUTED SYSTEMS Radhika Pasumarthi.
ICS Deadlocks 6.1 Deadlocks with Reusable and Consumable Resources 6.2 Approaches to the Deadlock Problem 6.3 A System Model –Resource Graphs –State.
Thursday, February 23, 2012 Chapter 6 homework questions?
Chapter 7: Deadlocks.
OPERATING SYSTEM CONCEPTS AND PRACTISE
Process Management Deadlocks.
Chapter 7: Deadlocks.
Termination detection
Synchronization: Distributed Deadlock Detection
Mutual Exclusion A condition in which there is a set of processes, only one of which is able to access a given resource or perform a given function at.
Ch 3 What is a deadlock ? Conditions Deadlock Models Hold and Wait
Chapter 18 Distributed Control Algorithms
The Echo Algorithm The echo algorithm can be used to collect and disperse information in a distributed system It was originally designed for learning network.
Chapter 7: Deadlocks.
Operating System: DEADLOCKS
Outline Distributed Mutual Exclusion Distributed Deadlock Detection
Process Deadlocks.
Distributed Mutual Exclusion
Distributed Deadlock Detection
Deadlock B.Ramamurthy CSE421 1/11/2019 B.Ramamurthy.
Chapter 7: Deadlocks.
Outline Deadlocks, dead lock prevention, avoidance.
Deadlock Prevention Restrain the ways request can be made.
Deadlocks Session - 14.
Deadlock B.Ramamurthy CSE421 2/23/2019 B.Ramamurthy.
Chapter 7: Deadlocks.
Deadlock B.Ramamurthy CSE421 4/23/2019 B.Ramamurthy.
Distributed Deadlock Detection
Deadlock B.Ramamurthy CSE421 5/1/2019 B.Ramamurthy.
Operating Systems Principles Process Management and Coordination Lecture 6: Deadlocks 主講人:虞台文.
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:

Chapter 7 –System Model – typical assumptions underlying the study of distributed deadlock detection Only reusable resources, only exclusive access, single copy of resource in system. –Besides deadlocks due to resources, we can have communication deadlocks –Strategies Prevention – can cause further problems. Consider one shot allocation where resources and requesters are on different sites. Avoidance – global state needs to be maintained, safe state checks need to be mutually exclusive.

Detection Issues –Detection Deadlocks should be detected in finite time. No false positives (phantom deadlocks) –Realize that states are not coherent. –Resolution Clean up the information upon rollback. Control Organizations Centralized Distributed Hierarchical

Distributed Deadlock Detection –Basic Centralized. All requests and release messages are sent to a designated site, which maintains a global WF Graph Problems – bottleneck, single POF, phantom deadlocks –Ho-Ramamoorthy 2 Phase Each site maintains a status table – resources locked and resources being waited upon. The central site periodically requests this table, constructs a global WFG, and searches for cycles. If a cycle is found, it requests the tables again, and constructs WFG from those transactions that are common to both tables. If a cycle is still detected, then a deadlock is declared.

–Ho-Ramamoorthy 1 phase Each site maintains 2 tables, one for resources (transactions that have locked a resource) and one for process status (resources locked/waited). These tables requested periodially by central site, and WFG constructed using those entries in the resource table which have corresponding entry in process table. Distributed Algorithms Path pushing: WFG constructed by disseminating dependency sequences Edge chasing: process sends out probes. A blocked process receiving probes circulates it along its outgoing dependency edges Diffusion: queries are diffused (sucessively propagated) and reflected Global State Detection

Obermack’s Algo. –Path pushing approach deals with transactions. Each transaction may have sub transactions, but they execute sequentially. Transactions are totally ordered. –Each site waits for deadlock related information (paths) from other sites. It abstracts the nonlocal portion of the WFG with a single node called EX. –It combines this with its own WFG. It then detects cycles and breaks those which do not contain EX. –For all cycles involving EX, the string indicating the cycle (EX- T1-T2-EX) is sent to all sites which have subtransactions of T2 waiting to recv a message from the subtransaction of T2 at this site. –Problem – this algorithm can detect phantom deadlocks. Needs n(n-1)/2 messages of O(n) size and detects in linear time.

Chandy-Misra- Haas –Edge chasing algorithm based on the AND model. –A process Pj is dependent on Pk if there is a sequence Pj, Pi1….Pin,Pk such that all process but Pk are blocked, and each process except Pj has something that is needed by its predecessor. Locally dependent –If Pi is locally dependent on itself, then we have a deadlock. Otherwise Forall Pj, Pk such that Pi locally depends on Pj and Pj is waiting(not locally) on Pk, send probe(i,j,k) to Pk.

–On receiving probe(i,j,k) If ( Pk is deadlocked && ! dependent k (i) && Pk has not replied to all requests of Pj ) –Dependent k (i) = true. –If (k == i) »Then Pi is deadlocked »Else Forall Pm, Pn such that Pk locally depends on Pm and Pm is dependent (not locally) on Pn, send probe(i,m,n) to Pk. –Sends 1 proble message on each edge of WFG, so m(n- 1)/2 messages for a deadlock with m processes over n sites. Size is fixed, and detection time is linear in number of sites

Diffusion Based Algorithm –Works for OR request model –Initiation: A blocked process i sends query(i,i,j) to all Pj in its dependent set; num i (i) = |DSi|, wait i (i) = true; –When a blocked process Pk recvs query (i,j,k) If this is engaging query, send query(i,k,m) to all processes in its dependent set, and set num k (i) and wait k (i) Else if wait k (i) then send reply(i,k,j) –When Pk gets reply(i,j,k) If wait k (i) –Decrement num k (i), if it becomes 0 then »If k == I then deadlock else reply(i,k,m) to the process which sent the engaging query.

Heirarchical Algorithms Menasce-Muntz Resources are managed by nodes that form the “leaves” of a tree. They maintain TWF/WFGs corresponding to the resources they manage. Several leaf controllers have a single parent, and so on in a tree fashion. Each non-leaf controller maintains WFG which is union of child WFGs. Changes are propagated upwards, and deadlocks detected on the way Hierarchical Ho-Ramamoorthy Sites split into disjoint clusters. Each cluster has its own control site. There is also a central control site.

Issues –Formal methods to prove correctness –Performance metrics No of messages ? Message size? Time to detect ? Storage overhead ? Computation overhead ? –Resolution – basically aborting a process How does a process know which others are involved in a deadlock ? Can two process detect the same deadlock simultaneously ? Use Priorities! Rollback – release resources, clean up graph –Phantom Deadlocks.