Deadlock Recovery


So, the deadlock has occurred. Now, how do we get the resources back and gain forward progress?

PROCESS TERMINATION:

·Could delete all the processes in the deadlock -- this is expensive.
·Delete one at a time until deadlock is broken ( time consuming ).
·Select who to terminate based on priority, time executed, time to completion, needs for completion, or depth of rollback
·In general, it's easier to preempt the resource, than to terminate the process.

RESOURCE PREEMPTION:

·Select a victim - which process and which resource to preempt.
·Rollback to previously defined "safe" state.
·Prevent one process from always being the one preempted ( starvation ).