Please enable JavaScript.
Coggle requires JavaScript to display documents.
THREE WAYS TO HANDLE DEADLOCK, Prevention/Avoidance - Coggle Diagram
THREE WAYS TO HANDLE DEADLOCK
Ignore problem and pretend that deadlocks never occur Used by most operating systems, including UNIX.
Ignorance
This method deadlock is eliminated for free rather than spending much on other deadlock prevention methods also putting some inconvenient restrictions on process. (
https://copyprogramming.com/t/deadlock-ignorance-in-operating-system
)
Deadlock ignorance can improve the performance of the system as detection/correction can consume significant system resources.(
https://www.geeksforgeeks.org/deadlock-ignorance-in-operating-system/
)
The recovery algorithm releases the resources held by one or more processes, allowing the system to continue to make progress.
If deadlocks do occur, the operating system must detect and resolve them
Advantages of Deadlock Detection and Recovery in Operating Systems:
Disadvantages of Deadlock Detection and Recovery in Operating Systems:
Risk of Data Loss: In some cases, recovery algorithms may require rolling back the state of one or more processes, leading to data loss or corruption.
False Positives and Negatives: Deadlock detection algorithms are not perfect and may produce false positives or negatives, indicating the presence of deadlocks when they do not exist or failing to detect deadlocks that do exist.
Complexity: Deadlock detection and recovery algorithms can be complex to implement, especially if they use advanced techniques such as the Resource Allocation Graph or Timestamping.
Performance Overhead: Deadlock detection and recovery algorithms can introduce a significant overhead in terms of performance, as the system must regularly check for deadlocks and take appropriate action to resolve them.
Better System Design: Deadlock detection and recovery algorithms can provide insight into the behavior of the system and the relationships between processes and resources, helping to inform and improve the design of the system.
Better Resource Utilization: By detecting and resolving deadlocks, the operating system can ensure that resources are efficiently utilized and that the system remains responsive to user requests.
Improved System Stability: Deadlocks can cause system-wide stalls, and detecting and resolving deadlocks can help to improve the stability of the system.
Detection /
Correction
Prevention/Avoidance
Ways to Prevent deadlock state
Ordered Request
Ordering is imposed on the resources and thus, process request are increasing in order. Ordering mean a process will request for a high resources than a low resources
Collective Request
All the processes will declare the request beforehand to make sure there is enough resources for the processes. When the process ended up processing then the resources will be release thus preventing the hold and wait deadlock state
Reference
https://www.geeksforgeeks.org/deadlock-handling-strategies-in-distributed-system/
Ensure that the system will never entered the deadlock state