Algorithm
Algorithm
Path-Pushing Algorithms
In path-pushing algorithms, distributed deadlocks are detected by maintaining an explicit global
WFG. The basic idea is to build a global WFG for each site of the distributed system. In this class of
algorithms, at each site whenever deadlock computation is performed, it sends its local WFG to all
the neighboring sites
2. Edge-Chasing Algorithms
In an edge-chasing algorithm, the presence of a cycle in a distributed graph structure is be verified
by propagating special messages called probes, along the edges of the graph. These probe
messages are different than the request and reply messages. The formation of cycle can be deleted
by a site if it receives the matching probe sent by it previously.
3. Diffusing Computations Based Algorithms
In diffusion computation based distributed deadlock detection algorithms, deadlock detection
computation is diffused through the WFG of the system. These algorithms make use of echo
algorithms to detect deadlocks. This computation is superimposed on the underlying distributed
computation. If this computation terminates, the initiator declares a deadlock global state detection.
4. Global State Detection Based Algorithms
Global state detection based deadlock detection algorithms exploit the following facts:
1 A consistent snapshot of a distributed system can be obtained without freezing the underlying
computation and
Lecture #9: Distributed Deadlock Detection
These topics are from Chapter 7 (Distributed Deadlock
Detection) in Advanced Concepts in OS
System Model
The systems have only reusable resources.
Processes are allowed only exclusive access to resources.
There is only one copy of each resource.
The text fudges a bit by forgetting that in some models the existence of a cycle is
necessary but not sufficient, and the existence of a knot is sufficient but not necessary,
leaving a gap.
Categorization of Methods
centralized control
distributed control
hierarchical control
Notice the similarity in principle here to the Chandy-Lamport global sate recording
algorithm, i.e., we need to capture not just the states of the processes but also the
states of the messages in transit.
Note: In the textbook, the rule above is reversed, i.e., it says to only send the path of
the first transaction is higher in lexical order than the first. Either rule will work. The
essential idea is simply to have one canonical representation of each
path.
Problems with Obermarck's Path-Pushing
Algorithm
Detects false deadlocks, due to asynchronous snapshots at different sites.
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 dependenti(j) = true � Pi knows that Pj is dependent on it
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
Pk is blocked
dependentk(i) = false
Pk has not replied to all requests of Pj
Analysis
m(n1)/2 messages for m processes at n sites in the book, is this right?
3-word message length
O(n) delay to detect deadlock
Observe that the engaging process arrows form a spanning tree of the subgraph
corresponding to the set of process for which the initiating process is waiting. If every
process in this subgraph is blocked, we have a knot.
At this point, a knot has been detected.
Details differ.
Graph Reduction
General idea: simulate the result of execution, assuming all unblocked processes
complete without requesting any more resources
while there is an unblocked process, remove the process and all (resource-
holding) edges to it
there is deadlock if the remaining graph is non-null