Download presentation
Presentation is loading. Please wait.
1
Day 17 Deadlock
2
Deadlock handling Prevention Avoidance Detection and Recovery
Integrated approach Ostrich approach
3
Deadlock detection and recovery
Draw a resource allocation graph To detect deadlock: If only one instance of each resource exists, a circular wait implies deadlock. If there are two or more instances of any resource, circular wait could mean deadlock. Must reduce the RAG to see if deadlock exists.
4
Recovery from deadlock
Abort all deadlocked processes. Back up each deadlocked process to some previously defined checkpoint and restart all processes. Widely used in current database systems. Danger of the same situation occurring again. Successively abort all deadlocked processes, until deadlock no longer exists. Must decide which process to abort first. Successively pre-empt resources until deadlock no longer exists. Must decide which process to pre-empt from
5
To choose which process to abort or to pre-empt a device from:
Least amount of processor time consumed so far Least amount of output produced so far Most estimated remaining time Least total resources allocated so far Lowest priority
6
An integrated approach
Group resources into a number of classes. Use linear ordering to prevent circular wait between classes. Within a class use an algorithm that is most appropriate for the class.
7
Ostrich approach Deadlocks are annoyances that occur rarely.
So, simply ignore the problem. It is a good strategy for applications that do not involve life and death situations (mission critical or business critical). So, most personal computers use this approach.
8
Systems where deadlock cannot be ignored
A real-time control system monitoring a gasoline refinery ensures the safe and proper operation of the refinery. An avoidance strategy or prevention strategy must be employed. A computerized pacemaker – can’t afford to miss a single beat deadlock avoidance or prevention must be employed Embedded computers – cell phones, PDAs. These are SoCs(system on chips) i.e. everything is on one chip and SoCs are characterized by a small set of resources and real-time processing constraints. Can’t have a system administrator come in and decide which process to abort after deadlock has been detected. Either a prevention or an avoidance strategy must be employed.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.