0% found this document useful (0 votes)
9 views

Lecture 16

The document discusses distributed deadlock detection in distributed systems. It covers deadlock fundamentals, distributed deadlock models, and algorithms for distributed deadlock detection including Obermarck's path-pushing algorithm and Chandy-Misra-Haas edge-chasing algorithm.

Uploaded by

kajelchasafe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Lecture 16

The document discusses distributed deadlock detection in distributed systems. It covers deadlock fundamentals, distributed deadlock models, and algorithms for distributed deadlock detection including Obermarck's path-pushing algorithm and Chandy-Misra-Haas edge-chasing algorithm.

Uploaded by

kajelchasafe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

FACULTY OF EGINEERING AND TECHNOLOGY

Distributed Systems (BCS-701)


LECTURE -16
Dr. Hariom Sharan
Professor & Dean
Computer Science & Engineering
OUTLINE

Deadlock

Fundamental Causes of Deadlock

Deadlock Handling Strategies

MCQ

Reference
DISTRIBUTED DEADLOCK DETECTION

Deadlock
Deadlock is a situation where a set of processes are blocked because each process is holding a resource and waiting for

another resource acquired by some other process.

Resource deadlock:

each process requests resources held by another process in the

set and it must receive all the requested resources before it can

become unblocked.

Communication deadlock:

each process is waiting for communication from another process,

and will not communicate until it receives the communication for

which it is waiting.
DISTRIBUTED DEADLOCK DETECTION

Fundamental Causes of Deadlock


 exclusive access

 wait while holding

 no preemption

 circular wait

All these conditions are necessary for deadlock to occur Hence, by preventing any one of these we prevent deadlock.

Deadlock Handling Strategies


 prevention

 avoidance

 detection
DISTRIBUTED DEADLOCK DETECTION

System Model
 The systems have only reusable resources.

 Processes are allowed only exclusive access to resources.

 There is only one copy of each resource.

Distributed Deadlock Models


Based on WFG (not GRG)

 Nodes are processes

 Resources are located at a site, but may be held by processes at other sites

 Edge (P,Q) indicates P is blocked and waiting for Q to release some resource

 Deadlock exists if there is a directed cycle or knot.


DISTRIBUTED DEADLOCK DETECTION
Distributed Deadlock Handling Strategies
Deadlock prevention

 All resource at once.

 Preventing a process from holding while waiting

 inefficient, can become deadlocked at resource acquiring phase, resource requirements are unpredictable -- not an

efficient, universal solution.

Deadlock avoidance

 A resource is granted to a process if the resulting state is safe

 Every site has to maintain the global state

 The checking for a safe state must be done with mutual exclusion

 The number of processes and resources in a distributed system is large

 Not a practical solution

Deadlock detection

 Once deadlock, always deadlock -- detection won't be outdated

 deadlock detection can be preceed concurrently with normal activities

 This is the usual approach


DISTRIBUTED DEADLOCK DETECTION

Distributed Deadlock Detection Issues


issues

 maintenance of WFG

 detection of cycles (or knots) in the WFG

requirements

 progress = no undetected deadlocks

 safety = no false deadlocks

Categorization of Methods
 centralized control

 distributed control

 hierarchical control
DISTRIBUTED DEADLOCK DETECTION

Classification of Distributed Detection Algorithms


path-pushing

 path information transmitted, accumulated

edge-chasing

 ``I'm waiting for you'' probes are sent along edges

 single returned probe indicates a cycle

diffusion

 ``Are you blocked?'' probes are sent along all edges

 all queries returned indicates a cycle

global state detection

 take and use snapshot of system state


DISTRIBUTED DEADLOCK DETECTION

Obermarck's Path-Pushing Algorithm


 designed for distributed database systems

 processes are called ``transactions'' T1, T2, ………….Tn

 there is special virtual node Ex

 transactions are totally ordered

Obermarck's Path-Pushing Algorithm


1. wait for info from previous iteration of Step 3

2. combine received info with local TWFG

 detect all cycles

 break local cycles

3. send each cycle including the node Ex to the external nodes it is waiting for

4. time-saver: only send path to other sites if last transaction is higher in lexical order than the first
DISTRIBUTED DEADLOCK DETECTION

Obermarck's Path-Pushing Algorithm


DISTRIBUTED DEADLOCK DETECTION

Problems with Obermarck's Path-Pushing Algorithm


 Detects false deadlocks, due to asynchronous snapshots at different sites.

 Message complexity? Message size? Detection delay?

 Exactly how are paths combined and checked?

Obermarck's Path-Pushing Algorithm: Performance


 O(n(n-1)/2) messages

 O(n) message size

 O(n) delay to detect deadlock


DISTRIBUTED DEADLOCK DETECTION

Chandy-Misra-Haas Edge-Chasing Algorithm


 for AND request model

 probe= (i,j,k) is sent for detection initiated by Pi, by site of Pj to site of Pk

 deadlock is detected when a probe returns to its initiator

Terminology
 Pj is dependent on Pk if there is a sequence Pj,Pi1,Pi2,…….Pim, Pk such that each process except Pk is

blocked and each process except the first holds a resource for which the previous process is waiting

 Pj is locally dependent on Pk if it is dependent and both processes are at the same site

 array dependent i(j) = true Û Pi knows that Pj is dependent on it


DISTRIBUTED DEADLOCK DETECTION

Algorithm Initiation by Pi
if Pi is locally dependent on itself then declare a deadlock else send probe (i, j, k) to home site of Pk for

each j, k such that all of the following hold

 Pi is locally dependent on Pj

 Pj is waiting on Pk

 Pj and Pk are on different sites


DISTRIBUTED DEADLOCK DETECTION

Algorithm on receipt of probe (i,j,k)


check the following conditions

 Pk is blocked

 Dependent k(i) = false

 Pk has not replied to all requests of Pj

if these are all true, do the following

 set dependentk(i) = true

 if k=i declare that Pi is deadlocked

 else send probe (i,m,n) to the home site of Pn for every m and n such that the following all hold

 Pk is locally dependent on Pm

 Pm is waiting on Pn

 Pm and Pn are on different sites


DISTRIBUTED DEADLOCK DETECTION

Algorithm on receipt of probe (i,j,k)


DISTRIBUTED DEADLOCK DETECTION

Algorithm on receipt of probe (i,j,k)

Chandy Misra Haas Complexity


 m(n-1)/2 messages for m processes at n sites in the book, is this right?

 3-word message length

 O(n) delay to detect deadlock


MCQ

1. What is the access point (AP) in a wireless LAN? 4. In wireless distribution system __________

a) device that allows wireless devices to connect to a wired a) multiple access point are inter-connected with each

network other

b) wireless devices itself b) there is no access point

c) both device that allows wireless devices to connect to a c) only one access point exists

wired network and wireless devices itself d) access points are not required

d) all the nodes in the network


2. In wireless ad-hoc network _________ 5. A wireless network interface controller can work in

a) access point is not required _______

b) access point is must a) infrastructure mode

c) nodes are not required b) ad-hoc mode

d) all nodes are access points c) both infrastructure mode and ad-hoc mode

3. Which multiple access technique is used by IEEE 802.11 d) WDS mode

standard for wireless LAN?


a) CDMA
b) CSMA/CA
c) ALOHA
d) CSMA/CD
REFERENCES

http://cs-www.cs.yale.edu/homes/aspnes/classes/465/notes.pdf

https://www.geeksforgeeks.org/mutual-exclusion-in-distributed-system/

https://www.vidyarthiplus.com/vp/attachment.php?aid=43022

http://www.cs.fsu.edu/~xyuan/cop5611/lecture9.html

http://www.cs.fsu.edu/~xyuan/cop5611/lecture10.html

You might also like