Recovery Of Deadlock

If resources have single instance.
Recovery of deadlock. In order to get rid of deadlocks the os periodically checks the system for any deadlock. Deadlock recovery performs when a deadlock is detected. Deadlock detection and recovery.
In this case for deadlock detection we can run an algorithm to check for cycle in the resource allocation graph. Prerequisite deadlock detection and recovery when a deadlock detection algorithm determines that a deadlock has occurred in the system the system must recover from that deadlock. When deadlock detected then our system stops working and after the recovery of the deadlock our system start working again.
Presence of cycle in the graph is the sufficient condition for deadlock. In this approach the os doesn t apply any mechanism to avoid or prevent the deadlocks. There are two approaches of breaking a deadlock.
In case it finds any of the deadlock then the os will recover. In this post deadlock detection and recovery technique to handle deadlock is discussed. The most common solution is to roll back one or more transactions to break the deadlock.
Checkpointing is saving enough state of a process so that process can restart from that checkpoint state later. To eliminate the deadlock we can simply kill one or more processes. Therefore the system considers that the deadlock will definitely occur.
Therefore after the detection of deadlock a method way must require to recover that deadlock to run the system again. Recovery from deadlock. Some operating system provides deadlock recovery by using checkpoint and rollback.