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 regular interval of time, it checks the wait for graph to detect a cycle. If cycle exits then it will declare system as deadlock otherwise the system will continue working. The major drawbacks of this technique are as follows:
- A site has to send request even for using its own resource.
- 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 or the other resource 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.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- Deadlock detection in Distributed systems
- Hierarchical Deadlock Detection in Distributed System
- Chandy-Misra-Haas's Distributed Deadlock Detection Algorithm
- Difference between Deadlock Prevention and Deadlock Avoidance
- Deadlock Detection And Recovery
- Deadlock Detection Algorithm in Operating System
- Operating Systems | Deadlock | Question 1
- Operating Systems | Deadlock | Question 2
- Interprocess Communication in Distributed Systems
- Synchronization in Distributed Systems
- Vector Clocks in Distributed Systems
- Deadlock Prevention And Avoidance
- Introduction of Deadlock in Operating System
- Introduction to TimeStamp and Deadlock Prevention Schemes in DBMS
- Program for Deadlock free condition in Operating System
- Deadlock, Starvation, and Livelock
- Recovery from Deadlock in Operating System
- Difference between Deadlock and Starvation in OS
- Conditions for Deadlock in Operating System
- Deadlock Ignorance in Operating System
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : RakshithSathish