0% found this document useful (0 votes)
48 views5 pages

Chandy-Misra Hass Algorithm

The Chandy-Misra-Haas distributed deadlock detection algorithm utilizes an edge chasing method with a probe message to identify deadlocks in distributed systems. It involves processes sending probe messages along a Wait for Graph, allowing a process to declare a deadlock if a probe returns to it. While the algorithm has advantages such as low overhead and no false deadlock reports, it also faces challenges like potential false deadlocks due to message delays and difficulties in implementation and scalability.

Uploaded by

srinidhi.26it
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views5 pages

Chandy-Misra Hass Algorithm

The Chandy-Misra-Haas distributed deadlock detection algorithm utilizes an edge chasing method with a probe message to identify deadlocks in distributed systems. It involves processes sending probe messages along a Wait for Graph, allowing a process to declare a deadlock if a probe returns to it. While the algorithm has advantages such as low overhead and no false deadlock reports, it also faces challenges like potential false deadlocks due to message delays and difficulties in implementation and scalability.

Uploaded by

srinidhi.26it
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

https://www.youtube.com/watch?

v=jAWBIIiZXTE
https://www.youtube.com/watch?v=b9G3cwLygPs
Chandy-Misra-Haas’s distributed deadlock
detection algorithm
Chandy-Misra-Haas’s distributed deadlock detection AND Model
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 Wait for Graph (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 P i 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:
 (a). Process Pi is locally dependent on process Pj
 (b). Process Pj is waiting on process Pk
 (c). Process Pj and process Pk are on different sites.
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:
 (a). Process Pk is blocked.
 (b). dependentk[i] is false.
 (c). Process Pk has not replied to all requests of process Pj
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:
 (a). Process Pk is locally dependent on process Pm and
 (b). Process Pm is waiting upon process Pn and
 (c). Process Pm and process Pn are on different sites.
4. Send probe (i, m, n) to the home site of process P n 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:
 Algorithm requires at most exchange of m(n-1)/2 messages to detect
deadlock. Here, m is number of processes and n is the number of
sites.
 The delay in detecting the deadlock is O(n).
Advantages:
 There is no need for special data structure. A probe message, which
is very small and involves only 3 integers and a two dimensional
boolean array dependent is used in the deadlock detection process.
 At each site, only a little computation is required and overhead is
also low
 Unlike other deadlock detection algorithm, there is no need to
construct any graph or pass nor to pass graph information to other
sites in this algorithm.
 Algorithm does not report any false deadlock (also called phantom
deadlock).
Disadvantages:
 The main disadvantage of distributed detection algorithms is that all
sites may not be aware of the processes involved in the deadlock
which makes resolution difficult. Also, proof of correction of the
algorithm is difficult.
 It may detect a false deadlock if there is a delay in message passing
or if a message is lost. This can result in unnecessary process
termination or resource preemption.
 It may not be able to detect all deadlocks in the system, especially if
there are hidden deadlocks or if the system is highly dynamic.
 It is complex and difficult to implement correctly. It requires careful
coordination between the processes, and any errors in the
implementation can lead to incorrect results.
 It may not be scalable to large distributed systems with a large
number of processes and resources. As the size of the system grows,
the overhead and complexity of the algorithm also increase.

Chandy-Misra-Haas’s distributed deadlock detection


OR model algorithm

You might also like