{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lecture9 - Deadlock Recovery Avoidance and Prevention...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Deadlock Recovery, Avoidance and Prev ention Recovering From Deadlock Once a deadlock has been detected, one of the 4 conditions must be invalidated to remove the dead- lock. Generally, the system acts to remove the circular wait, because making a system suddenly preemptive with respect to resources, or making a resource suddenly sharable is usually impractical. Because resources are generally not dynamic, the easiest way to break such a cycle is to terminate a process. Usually the process is chosen at random, but if more is known about the processes, that information can be used. For example the largest or smallest process can be disabled. Or the one waiting the longest. Such discrimination is based on assumptions about the system workload. Some systems facilitate deadlock recovery by implementing checkpointing and rollback. Check- pointing is saving enough state of a process so that the process can be restarted at the point in the computa- tion where the checkpoint was taken. Autosaving file edits is a form of checkpointing. Checkpointing costs depend on the underlying algorithm. Very simple algorithms (like linear primality testing) can be checkpointed with a few words of data. More complicated processes may have to sav e all the process state and memory. Checkpoints are taken less frequently than deadlock is checked for. If a deadlock is detected, one or more processes are restarted from their last checkpoint. The process of restarting a process from a check- point is called rollback . The hope is that the resource requests will not interleave again to produce dead- lock.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}