Open In App

Chandy-Misra-Haas’s Distributed Deadlock Detection Algorithm

Chandy-Misra-Haas’s distributed deadlock detection algorithm is an edge chasing algorithm to detect deadlock in distributed systems. 

In edge chasing algorithm, a special message called probe is used in deadlock detection. A probe is a triplet (i, j, k) which denotes that process Pi has initiated the deadlock detection and the message is being sent by the home site of process Pj to the home site of process Pk



The probe message circulates along the edges of WFG to detect a cycle. When a blocked process receives the probe message, it forwards the probe message along its outgoing edges in WFG. A process Pi declares the deadlock if probe messages initiated by process Pi returns to itself. 

Other terminologies used in the algorithm: 



  1. Dependent process: 
    A process Pi is said to be dependent on some other process Pj, if there exists a sequence of processes Pi, Pi1, Pi2, Pi3…, Pim, Pj such that in the sequence, each process except Pj is blocked and each process except Pi holds a resource for which previous process in the sequence is waiting. 
     
  2. Locally dependent process: 
    A process Pi is said to be locally dependent on some other process Pj if the process Pi is dependent on process Pj and both are at same site. 

Data structures: 
A boolean array, dependenti. Initially, dependenti[j] is false for all value of i and j. dependenti[j] is true if process Pj is dependent on process Pi

Algorithm: 

Process of sending probe: 

1. If process Pi is locally dependent on itself then declare a deadlock. 

2. Else for all Pj and Pk check following condition: 

If all of the above conditions are true, send probe (i, j, k) to the home site of process Pk

On the receipt of probe (i, j, k) at home site of process Pk: 

1. Process Pk checks the following conditions:  

If all of the above conditions are found to be true then: 

1. Set dependentk[i] to true. 
2. Now, If k == i then, declare the Pi is deadlocked. 
3. Else for all Pm and Pn check following conditions:  

4. Send probe (i, m, n) to the home site of process Pn if above conditions satisfy. 

Thus, the probe message travels along the edges of transaction wait-for (TWF) graph and when the probe message returns to its initiating process then it is said that deadlock has been detected. 

Performance:  

Advantages:  

Disadvantages: 

Article Tags :