0% found this document useful (0 votes)
21 views4 pages

An Effective Methodology For Deadlock Detection: Mamta Mishra, Miss. Madhulika Sharma

The document summarizes an effective methodology for deadlock detection in distributed systems. It presents an algorithm that detects deadlocks by having processes propagate messages to build a consistent snapshot of the wait-for graph. When a process blocks, it sends INVOKE messages along outgoing edges to record predecessors. Replies are sent back to determine if a cycle exists. The algorithm prioritizes instances to handle concurrent executions and ensures processes do not wait indefinitely to determine their state.

Uploaded by

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

An Effective Methodology For Deadlock Detection: Mamta Mishra, Miss. Madhulika Sharma

The document summarizes an effective methodology for deadlock detection in distributed systems. It presents an algorithm that detects deadlocks by having processes propagate messages to build a consistent snapshot of the wait-for graph. When a process blocks, it sends INVOKE messages along outgoing edges to record predecessors. Replies are sent back to determine if a cycle exists. The algorithm prioritizes instances to handle concurrent executions and ensures processes do not wait indefinitely to determine their state.

Uploaded by

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

International Journal of Engineering and Technical Research (IJETR)

ISSN: 2321-0869, Volume-3, Issue-4, April 2015

An Effective Methodology for Deadlock Detection


Mamta Mishra, Miss. Madhulika Sharma

arbitrary but finite delay. The messages are neither lost nor
Abstract In distributed algorithms, the pieces of the duplicated and the entire system is fault-free. The events in
algorithm are run concurrently and independently in different the system are classified into internal and external events,
processes over the distributed systems. Deadlocks are very and they are time stamped using logical clock. They are
thorny to detect in distributed systems. This is so because no site has further classified into computation events and control events.
precise knowledge about the system, and each inter-site The computation event triggers the computational messages
communication involves a finite and unpredictable delay. such as DEMAND, RESPONSE, CANCEL and ACKN due
Furthermore in distributed systems, depending on the applications, to the execution of applications. Whereas, the control event
processes make requests according to different resource model such generates the control messages including INVOKE and
as Single Resource Model, AND Model, OR Model, AND-OR STATUS as a result of the execution of deadlock detection
Model, P out-of Q Model (generalized model ) and Unrestricted algorithm.
Model.
III. DESCRIPTION OF THE ALGORITHM
Index TermsAND-OR Model, Q Model,OR Model
Whenever a process i blocks on a pi out-of qi demands, it
I. INTRODUCTION initiates the deadlock detection algorithm. A process i, called
originator, records the consistent snapshot of distributed wait
The available generalized deadlock detection algorithms are for graph by propagating the INVOKE messages along the
grouped into two categories namely Centralized Algorithms and outgoing edges in the wait for graph. When the replies are
Distributed Algorithms. In Centralized algorithms, the global propagated backwards to the originator, the algorithm
state of the system is preserved at the single site, whereas in the reduces the snapshot to determine a deadlock. The proposed
Distributed algorithms, the information needs to determine a algorithm follows the method of the algorithm proposed by
Kshemkalyani and Singhal (1994) for handling concurrent
deadlock is maintained across multiple sites. But, both kinds of
executions. According to the method, the algorithm assigns a
algorithms have a few precincts. Distributed algorithms have unique priority to each instance based on the originators
required additional round of messages for resolving deadlocks, identifier, and the time at which it was blocked. It supports
whereas Centralized algorithms have suffered with single point the execution of higher priority instance and suspends the
of failure, large communicational overhead, and congestion of execution of lower priority instances in the conflicting
communication links near the control site and local processes. Hence, each originator maintains its own snapshot
to detect a deadlock. For simplicity, this section describes the
computational complexity. To overcome those problems, the
single instance execution of proposed algorithm.
requirement for novel and better generalized deadlock detection
algorithm is apparent Hence, all processes have equal amount of IV. EXPLANATION OF THE ALGORITHM
information, and bear equal responsibility to take the final
decision. However, a single site needs to have enough memory When process i wants to find out whether it is deadlocked, it
space and processing power in the centralized algorithms. So, sends a INVOKE(i,i) message to all its successors (outi). The
first parameter of the INVOKE message is id of the process
the centralized algorithms are resource intensive. Moreover, the
that propagates the message and the second parameter is the
distributed algorithms are more reliable than the centralized id of the originator. When process j receives the INVOKE
algorithms due to the absence of single point of failure. Also, message from process i, it performs one of the following
they are easily scalable. actions.

i) If it is the first INVOKE message and process j is blocked,


II. SYSTEM MODEL AND PROBLEM it sets its fatherj to i and sends the INVOKE(j,originator)
CHARACTERIZATION message to all the processes in outj.
The system consists of n processes, where each has unique
ii) If it has already received a INVOKE message (i.e, fatherj
identity. The processes are communicating through a logical
udef), it includes the id of i in the set inj. It also reduces
communication channel by message passing. There is no
mj by one (mj = 0 implies that the process j receives the
shared memory in the system. The messages are delivered at
INVOKE message from all its successors).
the destination in the same order as sent by the sender, with

Manuscript received April 24, 2015.


iii) If process j is active, it sends STATUS(originator, j, true,
Mamta Mishra, College: Azad Institute Of Engineering & Techonology , ) to p r o c e s s i. The first parameter of the STATUS
Miss. Madhulika Sharma, Designation : H.O.D Of C.Se, College: Azad message is the id of the originator. The second and third
Institute Of Engineering & Techonology parameter represents the id and the state of the process that

515 www.erpublication.org
An Effective Methodology For Deadlock Detection

sends the message respectively. The fourth parameter is the


id of the process that would be a victim in case of deadlock
and fifth parameter is the number of predecessors of a
process victim. Since process j is active, it can not be a
victim. Therefore, the fourth and fifth parameter value is set
as in the message.

iv) If process j receives the INVOKE message through a


phantom edge (i.e, iINj), it sends a STATUS(i, j, true, , )
message immediately to process i.

Whenever process i receives the STATUS message, it


reduces ni (Initally, ni=|OUT i|) by one. Once it receives the
STATUS message from all its successors (i.e, ni=0), it
evaluates its unblocking condition (fi). If fi is evaluated as Figure 1 The Distributed wait for graph
true, it sends the STATUS message to its predecessors
without changing the victim and |invictim| in the message. Figure 2 shows the Directed Spanning Tree induced by the
Otherwise, it updates the fourth and fifth parameter of the execution of the proposed algorithm where solid lines
message by comparing number of its predecessors (|ini|) with represent the tree edges and dotted lines represent non-tree
|invictim|. If |ini| |invictim|, it sets process i as victim and edges.
sends STATUS(originator, i, false, i, |ini|) to its
predecessors. Else, it sends STATUS (originator, i, false,
victim, |invictim|) to its predecessors.

In some cases, process i is waiting to receive the STATUS


message from its own predecessor j in response to its
INVOKE message (i.e, when jini jouti) for determining
its state. In such cases, process i can not send the STATUS
message to its predecessors including the process j. This
problem is resolved as follows. When process i receives the
STATUS message, it reduces ni by one. In addition, it counts
the number of processes that act as both predecessor and
successor (loop). Therefore, it attempts to simplify its
unblocking condition (fi) at the time it has received niloop
STATUS messages. It then sends STATUS message to its
predecessors. This will ensure that any process that is
reachable from the originator does not wait indefinitely to Figure 2 The Directed Spanning Tree induced by SDRA
determine its state.
When the originator invokes the algorithm, it diffuses the
After receiving the STATUS message from all its immediate INVOKE messages across the wait for graph. Figure 3
successors, the originator evaluates its unblocking condition. shows the propagation of INVOKE message in the
If the unblocking condition of the originator is not evaluated distributed wait for graph by the algorithm.
as true, the algorithm declares deadlock. In that case, the
originator sends ABANDON message to a process victim
directly to resolve it.

V. EXAMPLE EXECUTION

This section illustrates the working principle of proposed


algorithm with the help of an example shown in Figure 1. Let
us consider the distributed wait for graph that spans six
processes labeled P1 to P6. Assume that, process P1 initiates
the deadlock detection algorithm and the messages are
propagated in such a way to induce a Breadth First Search
(BFS) spanning Tree. All the processes except P6 are
blocked. The unblocking conditions of all blocked processes
are given as follows: F1 = (P2 P3), F2 = (P4 P5) P6 ,

F3 = P5, F4 = P5 P6 and F5 = P3 P6.

Figure 3 Propagation of INVOKE messages in SDRA

516 www.erpublication.org
International Journal of Engineering and Technical Research (IJETR)
ISSN: 2321-0869, Volume-3, Issue-4, April 2015
The stepwise execution of SDRA algorithm is given below.
Assume that

Process P1 initiates the execution.

1. Process P1 sends the INVOKE(P1, P1) message to


processes P2 and P3 respectively.
2. When process P2 receives the INVOKE message from a
process P1, it propagates the INVOKE(P2, P1) message
to processes P4, P5 and P6 respectively.
3. When process P3 receives the INVOKE message from a
process P1, it sends INVOKE(P3, P1) message to P5.
4. When process P4 receives the INVOKE message from a Figure 4 Comparison of Deadlock Duration of three
process P2, it sends INVOKE(P4, P1) message to its Decentralized algorithms
successors P5 and P6 respectively. Figure 4.1 shows the deadlock duration plotted as a function
5. When process P5 receives the INVOKE message from of the MPL of the system. As shown in the Figure, mean
process P2, it sends INVOKE(P5, P1) message to its own deadlock detection duration resulting from SDRA is less than
successors P3 and P6 respectively. that from Bracha and Touegs algorithm. It is observed that
6. When an active process P6 receives the INVOKE deadlock duration of Kshemkalyani and Singhals algorithm
message from a process P2, it sends STATUS(P1, and SDRA is almost same for higher MPL values, which is
P6,true, , ) to process P2. consistent with complexity comparison presented in Table 1.
7. When process P5 receives the INVOKE message from a It is also observed that the deadlock detection duration
process P3 through a non-tree edge, it does not propagate increases with MPL until the number of processes reaches
the INVOKE message. 30, and then tapers to flat. The reason behind this is due to the
8. When an active process P6 receives the INVOKE increase of simply blocked nodes with MPL.
message from a process P4, it sends STATUS(P1,
P6,true, , ) to process P4.
9. When process P3 receives the INVOKE message from a
process P5 through a non-tree edge, it does not respond to
the message.
10. When an active process P6 receives the INVOKE
message from a process P5, it sends STATUS(P1,
P6,true, , ) to process P5.
11. When process P5 receives the INVOKE message from
process P6, it sends STATUS(P1 , P5 , false, P5 , 2) to
processes P2, P3 and P4 respectively.
12. When process P2 receives the STATUS message from a
process P5, it waits for the arrival of STATUS message
from its successor P4. Figure 5 Comparison of Message traffic of three
13. When process P3 receives the STATUS message from a Decentralized algorithms
process P5, it sends STATUS(P1, P3, false, P3, 2) to Figure 5 shows the mean number of deadlock detection
process P1. messages generated per algorithm execution with varying
14. When process P2 receives the STATUS message from a multiprogramming levels. As shown in the Figure, Bracha
process P4, it sends STATUS(P1, P2, true, P5, 2) to and Touegs algorithm passes 1.5 times more messages than
process P1. SDRA for higher MPL values. It is observed that SDRA and
Kshemkalyani and Singhals algorithm have required almost
VI. PERFORMANCE ANALYSIS SDRA same number of messages to detect deadlocks according to
the congruence with the theoretical expectation as in Table 1
This section compares the performance of proposed
algorithm in Chapter 3, with that of Bracha and Touegs
algorithm and Kshemkalyani and Singhals algorithm
(1999). The reason behind the selection of those two
particular algorithms is that the processs data structure of
those two algorithms is same as in SDRA. Also, all the
algorithms have detected the generalized deadlock in a
distributed manner.

Figure 6 Comparison of Message Size of three


Decentralized algorithms

517 www.erpublication.org
An Effective Methodology For Deadlock Detection

Figure 6 shows the mean length of deadlock detection REFERENCES


messages in terms of number of node identifiers for each
algorithm. It is observed that, as the MPL is increased in the [1] Ashfield, B., Deugo, D., Oppacher, F. and White, T. Distributed
system, the message length of Kshemkalyani and Singhals Deadlock Detection in Mobile Agent Systems, Proceedings of the
International Conference on Industrial and Engineering Applications
algorithm is also increased. However, the message length of of Artificial Intelligence and Expert Systems, pp. 146-156, 2002.
proposed and Bracha and Touegs algorithm is a constant. If [2] Bhalla, S. and Hasegawa, M. Automatic Detection of Multi-Level
the system is in deadlock, the Bracha and Touegs algorithm Deadlocks in Distributed Transaction Management Systems,
aborts the initiator to resolve a deadlock. However, it might Proceedings of the International Conference on Parallel Processing
Workshops, pp. 297-304, 2003.
not resolve all deadlocks reachable from the initiator. On the [3] Bukhres, O., Performance Comparison of Distributed Deadlock
contrary, the Kshemkalyani and Singhals algorithm selects a Detection Algorithms, Proceedings of IEEE Eighth International
victim by invoking additional procedure as the centralized Conference on Data Engineering, pp. 210-217, 1992.
algorithms. Since the initiator of proposed algorithm [4] Cao, J., Zhou, J., Zhu, W., Chen, D. And Lu, J. A Mobile Agent
identifies an appropriate victim without invoking any Enabled Approach for Distributed Deadlock Detection,
Proceedings of the Grid and Cooperative Computing, pp. 535-542,
additional procedure, the deadlock resolution time is very 2004.
less in proposed algorithm as compared to the Kshemkalyani [5] Cheng, X., Yang, X. and Jin, F. An Agent-Based Deadlock
and Singhals algorithm. It is observed that a deadlocked Detection/Resolution Algorithm for the AND Model, Proceedings
process having highest predecessor is aborted and it is more og the Sixth Conference on Parallel and Distributed Computing
Applications and Technologies, pp. 759-761, 2005.
likely that abortion of such a process might resolve a [6] Geetha, V. and Sreenath, N. Fault Informant Distributed Deadlock
deadlock. Detection Using Colored Probes, Proceedings of the Computer
Networks and Information Technologies, Communications in
Table 1 Performance Comparison of Distributed Computer and Information Science, Vol. 142, No. 1, pp.128-132,
algorithms forDetecting Generalized Deadlocks 2011.
[7] Hashemzadeh, M., Farajzadeh, N. and Haghighat, A.T. Optimal
detection and resolution of distributed deadlocks in the generalized
Wang.e Kshemkal Kshemkalya model, Proceedings of the Fourteen Euromicro International
Algorithms t als yani and ni and Conference on Parallel, Distributed, and Network-Based
Compariso algorith Singhals Singhals SDRA Processing, pp. 133-136, 2006.
n Factor m algorithm algorithm
(1990) (1994) (1999)

Deadlock
3d+1 2d 2d+2 2d
Duration
Message
6e 4e-2n+2l 2e 2e
Complexity
Message
O(1) O(1) O(e) O(1)
Size
Deadlock No e 1
No Scheme
Resolution Scheme Messages Message

VII. CONCLUSION

A new distributed deadlock detection algorithm namely


SDRA is presented. In this algorithm, the probes are
propagated along through the edges of wait for graph and the
replies are sent backwards towards the originator. The
reducibility of a blocked process is decided once it has
received the STATUS messages from all its descendants. If
the originator is not reduced at the end of termination, the
algorithm declares a deadlock. The correctness of proposed
SDRA is formally proved. It is shown that the message
complexity of 2e and time complexity of 2d is better or equal
to the existing algorithms. The notable improvement of this
algorithm is that it significantly reduces the message length
without using any explicit techniques. Also, it victimizes a
single process to resolve deadlock and eliminates the
message overhead associated with deadlock resolution as
compared to the existing distributed algorithms. However,
the proposed SDRA requires 2d time units to detect
deadlocks like the existing algorithms as opposed to
centralized generalized deadlock detection algorithms.

518 www.erpublication.org

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy