METHODS FOR HANDLING DEADLOCKS

 METHODS FOR HANDLING DEADLOCKS

•There are three ways of handling deadlocks:

1.Deadlock prevention or avoidance - Do not allow the system to get into a deadlocked state.
2.Deadlock detection and recovery - Abort a process or preempt some resources when deadlocks are detected.
3.Ignore the problem all together - If deadlocks only occur once a year or so, it may be better to simply let them happen and reboot as necessary than to incur the constant overhead and system performance penalties associated with deadlock prevention or detection.
This is the approach that both Windows and UNIX take.

•In order to avoid deadlocks, the system must have additional information about all processes.
In particular, the system must know what resources a process will or may request in the future.
(Ranging from a simple worst-case maximum to a complete resource request and release plan for each process, depending on the particular algorithm.)
•Deadlock detection is fairly straightforward, but deadlock recovery requires either aborting processes or preempting resources, neither of which is an attractive alternative.
•If deadlocks are neither prevented nor detected, then when a deadlock occurs the system will gradually slow down, as more and more processes become stuck waiting for resources currently held by the deadlock and by other waiting processes.
Unfortunately this slowdown can be indistinguishable from a general system slowdown when a real-time process has heavy computing needs.

No comments:

Post a Comment