Open In App

Deadlock Detection in Distributed Systems

Improve
Improve
Like Article
Like
Save
Share
Report

Prerequisite – Deadlock Introduction, deadlock detection 
In the centralized approach of deadlock detection, two techniques are used namely: Completely centralized algorithm and Ho Ramamurthy algorithm (One phase and Two-phase). 

  • Completely Centralized Algorithm – 
    In a network of n sites, one site is chosen as a control site. This site is responsible for deadlock detection. It has control over all resources of the system. If a site requires a resource it requests the control site, the control site allocates and de-allocates resources, and maintains a wait-for graph. And at a regular interval of time, it checks the wait-for graph to detect a cycle. If the cycle exits then it will declare the system as deadlock otherwise the system will continue working. The major drawbacks of this technique are as follows: 
    1. A site has to send requests even for using its own resource. 
    2. There is a possibility of phantom deadlock. 
  • HO Ramamurthy (Two-Phase Algorithm) – 
    In this technique a resource status table is maintained by the central or control site, if a cycle is detected then the system is not declared deadlock at first, the cycle is checked again as the system is distributed some of the other resources is vacant or freed by sites at every instant of time. Now, after checking if a cycle is detected again then, the system is declared as deadlock. This technique reduces the possibility of phantom deadlock but on the other hand time consumption is more. 
  • HO Ramamurthy (One Phase Algorithm) – 
    In this technique a resource status table and a process table is maintained by the central or control site if the cycle is detected in both processes and resource tables then, the system is declared as deadlock. This technique reduces time consumption but space complexity increases. 
     

Advantages:

  • Centralized deadlock detection techniques are easy to implement as they require only one site to be responsible for deadlock detection.
  • These techniques can efficiently detect deadlocks in large and complex distributed systems.
  • They can prevent the wastage of resources in a system due to deadlocks.

Disadvantages:

  • Centralized deadlock detection techniques can lead to a single point of failure as the control site can become a bottleneck in the system.
  • These techniques can cause high network traffic as all the requests and responses are sent to the control site.
  • Centralized deadlock detection techniques are not suitable for systems where resources are widely distributed. 

Last Updated : 08 May, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads