IJRIT International Journal of Research in Information Technology, Volume 2, Issue 9, September 2014, Pg. 806-811

International Journal of Research in Information Technology (IJRIT)

www.ijrit.com

ISSN 2001-5569

Deadlock Detection in Distributed Operating System Pratibha T Jose1 [Author] Department of Computer Science Dronacharya College of Engineering, Gurgaon Email: [email protected]

Shalini Sharma2[Co-author] Department of Computer Science Dronacharya college of Engineering, Gurgaon Email: [email protected]

Abstract A deadlock is a situation in which two or more competing actions are each waiting for the other to finish, and thus neither ever does. In computer science, deadlock refers to a specific condition two or more processes want to access the resources that are being used by other processes and those processes also require the resources held by the processes requesting to release the resources or if more than two processes are waiting for resources in a circular chain means a process wants the resource being held by another process which is sequentially next to the requesting process. For example if A,B,C are three processes and a requires the resource being used by B, B requires the resources being used by C and C requires the resources being used by A. Thus a cycle is formed. Deadlock is a common problems that usually occurs in multiprocessing because many processes share same resources and maybe at some point of time they also require same processors. This situation may be understood by an analogy with two people who are drawing diagrams, with only one pencil and one ruler between them. If one person takes the pencil and the other takes the ruler, a deadlock occurs when the person with the pencil needs the ruler and the person with the ruler needs the pencil, before he can give up the ruler. Both requests can't be satisfied, so a deadlock occurs. It is necessary to avoid deadlocks for the proper functioning of a system. Deadlocks decrease the efficiency of the centralized or distributed systems. In this paper we have discussed various ways of deadlock detection, deadlock avoidance and deadlock resolution in distributed systems.

Keywords: deadlocks, distributed operating systems, deadlock handling strategies, deadlock detection, deadlock avoidance, deadlock resolution

1. Introduction Deadlock can be defined a situation which arises in the distributed operating system where process may request resources in any order, which may be known priori and a process can request while holding others. If the sequence of these allocations of resources to the processes is not done in a controlled manner, deadlock can occurs. Deadlock is a situation where a set of process request resources that are held by other process in the set. Pratibha T Jose, IJRIT

806

IJRIT International Journal of Research in Information Technology, Volume 2, Issue 9, September 2014, Pg. 806-811

2. Distributed Operating system A distributed program is composed of a set of n synchronous processes p1,p2,p3,……pn that communicates by message passing over the communication network. Since there is loss of generality we assume that each process is running on different processor. The processor does not share a common global and communicates solely by passing messages over the communication network. Since there is no physical global clock in the system to which the process have instantaneous access. The Following things are assumed: • • • • • •

The system have only reusable resources Processes are allowed to make only exclusive access to resources There exists only one copy of resource It is well assumed that the process can run in two states: running and blocked states. In the active state, a process has all the needed resources and is either executing or is either ready for execution. When in the blocked state, a process is waiting to acquire some resources.

3. Deadlock Handling Strategies The deadlock has been a serious issue and efforts have been made in order to handle these deadlock. There are certain strategies that can help us avoid deadlock befre they occur on the systems. These are: • •

Deadlock prevention Deadlock Avoidance

3.1 Deadlock Prevention Prevention means structuring the system in such a way or sequencing the processes in such a way that guarantee that deadlocks can never happen. Four conditions that must hold true for a deadlock to occur: • Hold and wait – this is a condition when a process is allowed to hold onto one or more resources while it waits for other resources to get free which are required by the process. • Exclusive use – when a process is assigned a particular resource, then it is allowed to access the resource completely or exclusively. • Cyclical wait – when there is a circular chain of waiting processes where each process is waiting for a resource which is currently held by the next process in the chain. • No preemption – a process cannot take away the resources held by another process. Once that process is over only then the resource it is holding will be released. There can take place no pre-emption. If one out of these four conditions for deadlock is prevented, it prevents deadlock from happening. One way to do this is that, when the process is first started, it should be allotted all the resources that it may eventually require as time passes. The process should be allowed to start only if it has been allotted all the resources that it may be require during its span. All of the resources are acquired together, and when the process ends all the resources it was holding to are released altogether. Thus, hold and wait cannot occur. The major drawback of this scheme is that the processes are not allotted the resources because they need it but just because they may require them in long run. It is not sure whether they may really require them in their span. This basically renders the resources useless if they are not used while the process was on and this decreases the efficiency of the machine because until the process a holding a resource is not over, the resource cannot be used by any other process even if the resource is currently free. Another prevention scheme is to impose an order on the resources and require processes to request resources in increasing order. This prevents cyclic wait and thus makes deadlocks impossible.

Pratibha T Jose, IJRIT

807

IJRIT International Journal of Research in Information Technology, Volume 2, Issue 9, September 2014, Pg. 806-811

One advantage of prevention is that when deadlocks are not happening then there is no requirement to call them or roll them back. While most systems can deal with rollbacks, there are certain systems that cannot simple rollback processes. So for them deadlock prevention schemes are beneficial. 3.2 Deadlock Avoidance In deadlock avoidance, the system accepts the resource requests by different processes and checks or ensures that those requests don’t produce deadlocks. One Strategy used for deadlock avoidance is banker’s algorithm but this is useful in case of centralized systems and not beneficial for distributed systems. There are two popular avoidance algorithms based on timestamps or priorities namely: wound-wait and wait-die. These algorithms assign resources to the processes on the basis of timestamps and priorities assigned to the processes. Some authors refer to these as prevention. •

Wound-wait In wound-wait, if there is a process B that is waiting for a resource that is held by process A and if the burst time of the process is B is less then process A will wind up and the resources will be allocated to process B. if the timestamp of the process A is less than A will finish its process first and then the resource will be allocated to B. Deadlock cycles cannot occur since processes only wait for older processes. In wait-die, if a request from process A conflicts with process B, A will wait if B has the larger timestamp (is younger). If B is the older process, A is not allowed to wait, so it dies and restarts.



Timeout In timeout based avoidance, a process it requests a resource that is not currently available then the process is blocked. It is aborted and restarted if it has been blocked longer than a particular timeout period. Given the uncertainty of message delays in distributed systems, it is difficult to determine good timeout values.

These avoidance strategies have the disadvantage that the aborted process may not have been actually involved in a deadlock.

Fig: System for internode deadlock avoidance in parallel distributed systems

Pratibha T Jose, IJRIT

808

IJRIT International Journal of Research in Information Technology, Volume 2, Issue 9, September 2014, Pg. 806-811

4. Deadlock Detection As it has been observed that handling a deadlock is big task as it becomes highly complicated in distributed systems because no site has accurate knowledge of the current state of the system and because every inter site communication involves a finite and unpredictable delay. Deadlock Detection: requires examination of the status of process resource interactions for presence of cyclic wait, so this approach seems to be the best approach to handle deadlocks in the distributed systems.

Fig: a chain deadlock 4.1 Issues in Deadlock Detection Deadlock detection is measured to be the efficient method in handling the deadlocks . When using the technique of Deadlock detection entails addressing two basic issues: First detection of existing deadlocks and second resolution of detected deadlock. Detection of deadlocks involves addressing two issues: Maintenance of the WFG and searching of the WFG for the presence of cycle. So an algorithm must be developed which may make correction to the Deadlock detection. So in order to develop an algorithm, it should satisfy following two condition: 4.2 Progress (No Repeated deadlock) Algorithm designed must detect all deadlocks in finite time or we can say that all wait for dependencies for a deadlock have been removed, the desired algorithm must not wait for any more events to occur to detect deadlock. Safety: The algorithm should not repeat deadlocks which do not exists at all. 4.3 Deadlock Detection Algorithms According to Knapp’s classification distributed deadlock detection algorithms can be divided into four classes: •

Edge-chasing algorithm In an edge-chasing algorithm, the presence of a cycle in a distributed graph structure can be detected by passing special messages called probes, along the edges of the graph. These probe messages are different than the request and reply messages. If a site receives the matching probe sent by it previously then we can ensure a cycle in the graph and that can be deleted. Whenever a process that is executing receives a

Pratibha T Jose, IJRIT

809

IJRIT International Journal of Research in Information Technology, Volume 2, Issue 9, September 2014, Pg. 806-811

probe message, it discards this message and continues. Only blocked processes propagate probe messages along their outgoing edges. Main advantage of edge-chasing algorithms is that probes are fixed size messages which are normally very short. •

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. To detect a deadlock, a process sends out query messages along all the outgoing edges in the WFG. These queries are successively propagated (i.e. diffused) through the edges of the WFG



Path-Pushing Algorithms In path-pushing algorithms, distributed deadlocks are detected by maintaining an explicit global WFG. In this class of algorithms, at each site whenever deadlock computation is performed, it sends its local WFG to all the neighbouring sites. After the local data structure of each site is updated, this updated WFG is then passed along to other sites, and the procedure is repeated until some site has a sufficiently complete picture of the global state to announce deadlock or to establish that no deadlocks are present. The basic idea is to build a global WFG for each site of the distributed system. This feature of sending around the paths of global WFG has led to the term path-pushing algorithms.



Diffusion computation based distributed deadlock 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. To detect a deadlock, a process sends out query messages along all the outgoing edges in the WFG. These queries are successively propagated (i.e., diffused) through the edges of the WFG.

5. Deadlock Resolution Deadlock resolution involves breaking existing wait for dependencies between the processes to resolve the deadlock. It also involves rolling back one or more deadlocked processes and assigning their resources to blocked processes so that they can resume execution. Efficient resolution of the deadlocks requires the knowledge of all the processes that are involved in the deadlock and the resources they have held with them. The speed of resolution depends on how much information regarding the deadlock was passed around during the deadlock detection phase. In distributed systems the deadlock resolution is complex due to the following reasons: • •

A process that detects a deadlock doesn’t have the knowledge of all the processes involved in the deadlock. If two or more processes detect same deadlocks and they all individually try to resolve them, then this deadlock resolution becomes inefficient because many processes will abort different processors.

An efficient resolution involves following steps: • • •

Select a victim that is most optimal to be aborted. This task can be tedious to a great extent. Release all the resources held by the victim process and restore all the resources to their original states and a lot these resources to the deadlocked processes. Delete all the deadlock detection information about the victim from all sites.

Pratibha T Jose, IJRIT

810

IJRIT International Journal of Research in Information Technology, Volume 2, Issue 9, September 2014, Pg. 806-811

6. Conclusion Deadlocks in a distributed system drastically deteriorate the performance of the system and therefore have to be detected and resolved as early as possible for the efficiency of the systems. In this paper we have discussed various ways of detecting the deadlocks And if a deadlock could not be avoided then we should implement efficient ways for resolving them.

7. References [1] An Efficient Detection and Resolution of Generalized http://www.ijcaonline.org/journal/number19/pxc387610.pdf

Deadlocks

in

Distributed

Systems

[2] Locks, Blocks and Deadlocks http://docs.oracle.com/cd/E17277_02/html/TransactionGettingStarted/blocking_deadlocks.html [3] Deadlock Detection in Distributed Systems http://cs.hbg.psu.edu/comp512.papers/singhaldeadsurvey-1.pdf [4] Analysis for Deadlock Detection and Resolution Techniques http://www.ijarcsse.com/docs/papers/Volume_3/7_July2013/V3I7-0219.pdf

in

Distributed

Systems

[5] Deadlock Detection in Distributed Systems by Ajay Kshemkalyani and Mukesh Singhal Distributed Computing: Principles, Algorithms, and Systems http://www.cs.uic.edu/~ajayk/Chapter10.pdf

Pratibha T Jose, IJRIT

811

Deadlock Detection in Distributed Operating System

In computer science, deadlock refers to a specific condition two or more processes ... Keywords: deadlocks, distributed operating systems, deadlock handling ...

500KB Sizes 3 Downloads 199 Views

Recommend Documents

Deadlock Detection & Deadlock Prevention of Distributed System
deadlock detection and prevention approaches for distributed database. ... aspects of distributed systems, they are harder to detect, avoid, and prevent.

Deadlock in Distributed Operating System
Examples are given to illustrate these methods for avoiding file .... of files, such communications are never required to handle processes using only local files.

Distributed Operating System
IJRIT International Journal of Research in Information Technology, Volume 1, ... control unifies the different computers into a single integrated compute and ... resources, connections between these processes, and mappings of events ... of excellent

Static Deadlock Detection for Asynchronous C# Programs
contents at url are received,. GetContentsAsync calls another asynchronous proce- dure CopyToAsync .... tions are scheduled, and use it to define and detect deadlocks. ...... work exposes procedures for asynchronous I/O, network op- erations ...

Static Deadlock Detection for Asynchronous C# Programs
CCS Concepts • Software and its engineering → Dead- locks; Automated static ...... accounting software [9] and a number-tracking API [14]. Our focus was to find ...

DISTRIBUTED OPERATING SYSTEM.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. DISTRIBUTED ...

Fault Tolerance in Distributed System - IJRIT
Fault-tolerant describes a computer system or component designed so that, in the event that a component fails, a backup component or procedure can immediately ... millions of computing devices are working altogether and these millions of ...

Fault Tolerance in Distributed System - IJRIT
Fault Tolerance is an important issue in Distributed Computing. ... The partial failure is the key problem of the distributed system, .... architecture and design.

Leak detection system
Sep 12, 1988 - a series of precisely-aligned and formed spiral grooves that cooperate with several parallel helical grooves formed in the stator. The use of the ...

Optimal Model Detection in Distributed Sensor ...
determine the environment model for decentralized detection in sensor networks. We develop a clustering ... Utilizing model clustering, Genetic-Fuzzy Model Detection. (GFMD) can obtain the optimal threshold in a ..... computer intrusion detection,”

Phishing Detection System
various features such as HTML Email, IP-based URL, no of domains used,age ... E. Classifying Phishing Emails Using Confidence-Weighted Linear Classifiers.

Distributed File System
Hadoop file. System. Clustered- based, asymmetric. , parallel, object based. Statef ul ... File System http://hadoop.apache.org/core/docs/current/hdfs_de sign.html.

operating- system concepts
Internet electronic mail should be addressed to [email protected]. Physical mail .... In order for two machines to provide a highly available service, the state on the two .... lines, such as a high-speed bus or local area network. h. Clustered.

Android (operating system)
Oct 21, 2008 - Android (operating system) - Wikipedia, the free encyclopedia ... [10]. ), Rich Miner. (co-founder of Wildfire Communications, Inc. [11]. ) ...

Intruder detection and warning system
(22) Filed: Feb. 4, 2010. (57). ABSTRACT. Related U's' Patent Documents. An intruder detection and warning system has a plurality of. Reissue 0ft infrared ...

Intruder detection and warning system
Feb 4, 2010 - 6,943,685 B2* 9/2005 Seo ............................. .. 340/541 ... (21) Appl- NO-1 12/700'241. (74) Attorney, Agent, or Firm 4 Bacon & Thomas, PLLC.

Distributed Node with Distributed Quota System (DNDQS).pdf ...
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Distributed ...

A distributed system architecture for a distributed ...
Advances in communications technology, development of powerful desktop workstations, and increased user demands for sophisticated applications are rapidly changing computing from a traditional centralized model to a distributed one. The tools and ser

DEADLOCK SIMULATOR.pdf
Whoops! There was a problem loading more pages. Retrying... DEADLOCK SIMULATOR.pdf. DEADLOCK SIMULATOR.pdf. Open. Extract. Open with. Sign In.

A Distributed Speech Recognition System in Multi-user ... - USC/Sail
A typical distributed speech recognition (DSR) system is a configuration ... be reduced. In this context, there have been a number of ... block diagram in Fig. 1.

[O973.Ebook] Ebook Operating System: Operating ...
Jan 21, 2016 - prosperous system by reading this soft file of the Operating System: Operating System For Beginners ... What do you think of our concept here?

Distributed Load-Balancing in a Multi-Carrier System
of SLIM to cases where Quality-of-Service (QoS) parameters are specified and ... For example, a cellular network based on EVDO-RevB [1] is one such system.