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

International Journal of Research in Information Technology (IJRIT)

www.ijrit.com

ISSN 2001-5569

Deadlock in Distributed Operating System 1 1,2,3

2

3

Vijay Gupta, Virender Gupta, Ankit Gahlot

Computer Science of Engineering Department, Dronacharya College Of Engineering,Gurgoan vjgupta252gmail.com ,[email protected] ,[email protected] Abstract

Deadlock prevention mechanisms and a deadlock protection mechanism for distributed data base systems are presented. The notion of process sets used in preventing deadlock is introduced. Examples are given to illustrate these methods for avoiding file deadlock in computer networks. This paper examines a means of implementing deadlock prevention mechanisms and a deadlock detection mechanism on a computer network. In addition, the notion of using process sets is introduced to improve the efficiency of the deadlock prevention mechanisms.

1. Introduction Deadlocks in distributed systems are similar to deadlocks in single processor systems, only worse. They are harder to avoid, prevent or even detect. They are hard to cure when tracked down because all relevant information is scattered over many machines. People sometimes might classify deadlock into the following types: Communication deadlocks -- competing with buffers for send/receive Resources deadlocks -- exclusive access on I/O devices, files, locks, and other resources. We treat everything as resources, there we only have resources deadlocks. Four bestknown strategies to handle deadlocks: The ostrich algorithm (ignore the problem) Detection (let deadlocks occur, detect them, and try to recover) Prevention (statically make deadlocks structurally impossible) Avoidance (avoid deadlocks by allocating resources carefully). Ignorance: ignore the problem; assume that a deadlock will never occur. This is a surprisingly common approach. Detection let a deadlock occur, detect it, and then deal with it by aborting and later restarting a process that causes deadlock. Prevention: make a deadlock impossible by granting requests so that one of the necessary conditions for deadlock does not hold. Avoidance: choose resource allocation carefully so that deadlock will not occur. Resource requests can be honored as long as the system remains in a safe (non-deadlock) state after resources are allocated.

2. Access Control Methods In many cases, such as program libraries, it is necessary for two or more processes to have simultaneous access to the same file. However, a process which modifies a file cannot share access to that file with any other process at the same time. In order to provide users with this flexibility, a system must provide two methods access to every file, either shared or exclusive. Vijay Gupta, IJRIT

313

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

The user specifies the desired method of access when the file is requested. Using this procedure if no process has been granted exclusive access to a file, then a request for shared access to that file by any process can be granted. In the same manner, if no process has been granted either shared or exclusive access to a file, then a request for exclusive access to that file by any process can be granted. This procedure provides multiple readers or one writer with access to a specific file. If it is possible for the system to conveniently generate a copy of a file when a process requires exclusive access to a file, the copy may be used for modifications while the original is maintained as a backup until the process terminates. In addition, access to the original can be granted to any process requesting shared access to that file. Consequently, shared access to a file can always be granted and requests for such access need no longer be considered by the deadlock protection mechanism. This procedure allows the system to provide multiple readers and one writer, with simultaneous access to a specific file.

When a data base has multiple copies of a file, for shared access of a file, access to any one of its copies can be granted to the requesting process; for exclusive access of a file, all of its copies must be granted to the requesting process. With such a "lock" scheme for the exclusive access, the deadlock mechanisms are not affected by the number of copies of a file.

3. Deadlock in Distributed Operating System Deadlocks in distributed systems are similar to deadlocks in single processor systems, only worse .They are harder to avoid, prevent or even detect. They are hard to cure when tracked down because all relevant information is scatter over many machines. People sometimes might classify deadlock into the following types of Communication deadlocks -- competing with buffers for send/receive. Resources deadlocks -- exclusive access on I/O devices, files, locks, and other resources. We treat everything as resources, there we only have resources deadlocks. Four best-known strategies to handle deadlocks: The ostrich algorithm (ignore the problem) Detection (let deadlocks occur, detect them, and try to recover) Prevention (statically make deadlocks structurally impossible) Avoidance (avoid deadlocks by allocating resources carefully)

Vijay Gupta, IJRIT

314

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

4. The FOUR Strategies for handling deadlocks The ostrich algorithm •

No dealing with the problem at all is as good and as popular in distributed systems as it is in singleprocessor systems.



In distributed systems used for programming, office automation, process control, no system-wide deadlock mechanism is present -- distributed databases will implement their own if they need one.



Deadlock detection and recovery is popular because prevention and avoidance are so difficult to implement.



Deadlock prevention is possible because of the presence of atomic transactions. We will have two algorithms for this.



Deadlock avoidance is never used in distributed system, in fact, it is not even used in single processor systems.



The problem is that the banker’s algorithm need to know (in advance) how much of each resource every process will eventually need. This information is rarely, if ever, available.Hence, we will just talk about deadlock detection and deadlock prevention.

5. Distributed Deadlock Detection Since preventing and avoiding deadlocks to happen is difficult, researchers works on detecting the occurrence of deadlocks in distributed system. The presence of atomic transaction in some distributed systems makes a major conceptual difference . When a deadlock is detected in a conventional system, we kill one or more processes to break the deadlock --- one or more unhappy users. When deadlock is detected in a system based on atomic transaction, it is resolved by aborting one or more transactions. But transactions have been designed to withstand being aborted. When a transaction is aborted, the system is first restored to the state it had before the transaction began, at which point the transaction can start again. With a bit of luck, it will succeed the second time. Thus the difference is that the consequences of killing off a process are much less severe when transactions are used.

6. Centralized Deadlock Detection We use a centralized deadlock detection algorithm and try to imitate the non-distributed algorithm. Each machine maintains the resource graph for its own processes and resources. A centralized coordinator maintain the resource graph for the entire system. When the coordinator detect a cycle, it kills off one process to break the deadlock. In updating the coordinator’s graph, messages have to be passed.

• • •

Method 1) Whenever an arc is added or deleted from the resource graph, a message have to be sent to the coordinator. Method 2) Periodically, every process can send a list of arcs added and deleted since previous update. Method 3) Coordinator ask for information when it needs it.

Vijay Gupta, IJRIT

315

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

Vijay Gupta, IJRIT

316

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

7. Distributed Deadlock Prevention A method that might work is to order the resources and require processes to acquire them in strictly increasing order. This approach means that a process can never hold a high resource and ask for a low one, thus making cycles impossible. With global timing and transactions in distributed systems, two other methods are possible -- both based on the idea of assigning each transaction a global timestamp at the moment it starts. When one process is about to block waiting for a resource that another process is using, a check is made to see which has a larger times. We can then allow the wait only if the waiting process has a lower time stamp. The timestamp is always increasing if we follow any chain of waiting processes, so cycles are impossible --- we can used decreasing order if we like. It is wiser to give priority to old processes because they have run longer so the system have larger investment on these processes. They are likely to hold more resources . A young process that is killed off will eventually age until it is the oldest one in the system, and that eliminates starvation.

8. Wait-die Vs. Wound-wait As we have pointed out before, killing a transaction is relatively harmless, since by definition it can be restarted safely later. Wait-die: If an old process wants a resource held by a young process, the old one will wait. If a young process wants a resource held by an old process, the young process will be killed. Observation : The young process, after being killed, will then start up again, and be killed again. This cycle may go on many times before the old one release the resource. Once we are assuming the existence of transactions, we can do something that had previously been forbidden: take resources away from running processes. When a conflict arises, instead of killing the process making the request, we can kill the resource owner. Without transactions, killing a process might have severe consequences. With transactions, these effects will vanish magically when the transaction dies. Wound-wait: (we allow preemption & ancestor worship) If an old process wants a resource held by a young process, the old one will preempt the young process -- wounded and killed, restarts and wait. If a young process wants a resource held by an old process, the young process will wait.

Vijay Gupta, IJRIT

317

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

9. False Deadlocks

Machi

Machi

Coordin

Coordin

A S

C

S C

S C

R

T

T

T

B B release R, and •

One possible way to prevent false deadlock is to use the Lamport’s algorithm to provide global timing for the distributed systems.



When the coordinator gets a message that leads to a suspect deadlock:



It send everybody a message saying “I just received a message with a timestamp T which leads to deadlock.



If anyone has a message for me with an earlier timestamp, please send it immediately” When every machine has replied, positively or negatively, the coordinator will see that the deadlock has really occurred or not.

10. Conclusion Three methods of protecting the user from deadlocks in a distributed data base have been presented :a simple deadlock prevention mechanism, a prevention mechanism using process sets, and a detection mechanism. The operation of the simple prevention mechanism is straightforward and uncomplicated, and it does not require the keeping of lists or groups; thus this mechanism is easily implemented and requires less system overhead than the other mechanisms. In addition, since messages are sent to the other nodes of the network only to establish the location and availability of files, such communications are never required to handle processes using only local files. Since the simple prevention mechanism is the only deadlock protection mechanism to exhibit both of these characteristics, it is clearly superior for most applications. However, since the process set prevention mechanism provides more efficient utilization of files, and the detection mechanism provides the user with greater flexibility in that the user may request access to files at any time, in certain instances these mechanisms are preferable.

Vijay Gupta, IJRIT

318

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

Vijay Gupta, IJRIT

319

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

11. References 1.CHANDY, K.M., AND MISRA, J. A distributed algorithm for detecting resource deadlocks in distributed systems. In Proc. A CM SIGA CT-SIGOPS Syrup. Principles of Distributed Computing (Ottawa, Canada, August 18-20, 1982), ACM, New York, 1982, pp. 157-164. 2. DIJKSTRA, n.w., AND SCHOLTEN, C.S. Termination detection for diffusing computations. Inf. Process. Lett. 11, 1 (Aug. 1980), 1-4. 3. GLIGOR, V.D., AND SHATTUCK, S.H. Deadlock detection in distributed systems. IEEE Trans.Softw. Eng. SE6, 5 (Sept. 1980), 435-440. 4. GOLDMAN, B. Deadlock detection in computer networks. Tech. Rep. MIT-LCS-TR185, Massachusetts Institute of Technology, Cambridge, Mass., Sept. 1977. 5. GRAY, J.N. Notes on database operating systems. In Operating Systems: An Advanced Course, vol. 60, Lecture Notes in Computer Science, Springer-Verlag, New York 1978, pp. 393-481. 6. HAAS, L.M. Two approaches to deadlock in distributed systems. Ph.d. dissertation, Computer Science Dept., Univ. of Texas at Austin, July 1981. 7. HOARE, C.A.R. Communicating sequential processes. Commun. ACM21, 8 (Aug. 1978), 666-677. 8. MENASCE, D., AND MUNTZ, R. Locking and deadlock detection in distributed databases. IEEE Trans. Softw. Eng. SE-5, 3 (May 1979), 195-202. 9. MISRA, J., AND CHANDY, K.M. Termination detection of diffusing computations in communicating sequential processes. ACM Trans. Program. Lang. Syst. 4, 1 (Jan. 1982).

Vijay Gupta, IJRIT

320

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.

376KB Sizes 2 Downloads 274 Views

Recommend Documents

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 ...

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.

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

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.

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]. ) ...

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.

A Distributed Speech Recognition System in Multi-user Environments
services. In other words, ASR on mobile units makes it possible to input various kinds of data - from phone numbers and names for storage to orders for business.

A Distributed Speech Recognition System in Multi-user ... - USC/Sail
tion performance degradation of a DSR system. From simulation results, both a minimum-mean-square-error. (MMSE) detector and a de-correlating filter are shown to be effective in reducing MAI and improving recognition accuracy. In a CDMA system with 6

Operating the production calculus: ordering a production system in the ...
production system in the print industry ... change and scheduling technologies have been developed to automate this ... systems of social control and the like.

race condition in operating system pdf
race condition in operating system pdf. race condition in operating system pdf. Open. Extract. Open with. Sign In. Main menu.

Fault Tolerance in Operating System - IJRIT
Dronacharya College of Engineering, Gurgaon, HR ... Software Fault-Tolerance -- Efforts to attain software that can tolerate software design faults (programming errors) have made use of static and .... a way that when a process is loaded, the operati

secondary storage management in operating system pdf ...
Whoops! There was a problem previewing this document. Retrying... Download ... secondary storage management in operating system pdf. secondary storage ...

Advances in Operating System July 2016 (2014 Scheme).pdf ...
Advances in Operating System July 2016 (2014 Scheme).pdf. Advances in Operating System July 2016 (2014 Scheme).pdf. Open. Extract. Open with. Sign In.