Distributed Deadlock: Nargish
Distributed Deadlock: Nargish
Distributed Deadlock: Nargish
Nargish.
Deadlock Problem
Deadlock is a situation where a set of process is blocked
waiting on an event that will never occur
Deadlock is a situation in
which a set of processes is
Running
blocked waiting for other
process in the set to release
the resource Blocked
Deadlock Characterization
Deadlock can occur in four conditions hold simultaneously:-
Mutual exclusion: only one process at a time can use a
resource.
Hold and wait: a process holding resource(s) is waiting to
acquire additional resources held by other processes.
No preemption: a resource can be released only voluntarily by
the process holding it upon its task completion.
Circular wait: there exists a set {P0, P1, …, P0} of waiting
processes such that P0 is waiting for a resource that is held by P1, P1
is waiting for a resource that is held by P2, …, Pn–1 is waiting for a
resource that is held by Pn, and Pn is waiting for a resource that is held
by P0.
False Deadlock
Detecting a nonexistent deadlock in distributed systems
has been referred to as false deadlock detection. This
correspondence shows that false deadlock will never
occur in a system of two-phase locking transactions.
Resource vs Communication
Deadlock
Two types of deadlocks have been discussed:
Resource deadlock:-
• Processes can simultaneously wait for several resources and cannot
proceed until they have acquired all those resources
• A set of processes is resource-deadlock if each process in the set
requests resources held by another process in the set and it must
receive all of the requested resources before it can become unblocked
Communication deadlock:-
• Processes wait to communicate with other processes among a set of
processes
• A waiting process can unblock on receiving a communication from any
one of these processes
• A set of processes is communication deadlocked if each process in the
set is waiting to communicate with another process in the set and no
process in the set ever initiates any further communication until it
receives the communication for which it is waiting
Resource Deadlock
Resource Deadlock uses AND condition.
AND conditions:
a process that requires resources for execution can
proceed when it has acquired all those resources.
P1 P3
P2
S1
P6 P4
P8
P5
P9
P7
P10
S2
S3a cycle but no knot No Deadlock in the OR model
There is
Communication Deadlock
Communication Deadlock uses OR condition.
OR conditions:
a process that requires resources for execution can proceed
when it has acquired one of those requested resources.
P3 P3
P1 P2 P4 P1 P2 P4
P5
P5
No No
Deadlock
deadlock Deadlock Deadlock
Resource Allocation Graph
Process
Pi requests instance of Rj
Pi
R
Pi is holding an instance of Rj j
Deadlock No Deadlock
Resource Allocation Graph With A
Deadlock
P1 P2
P4 P3
Deadlock occur
Deadlock Handling Strategies
Deadlock Prevention: difficult to achieve.
Deadlock Avoidance: before allocation, check for
possible deadlocks.
Difficult as it needs global state info in each site (that handles
resources).
Distributed Control:-
o WFG is spread over different sites. Any site can initiate the
deadlock detection process.
Hierarchical Control:-
o Sites are arranged in a hierarchy.
o A site checks for cycles only in descendents.
B. Prabhakaran 23