Deadlock Recovery in Operating System

Deadlock recovery occurs when a deadlock is detected. When a deadlock is detected, our system stops working, and when the deadlock is resolved, our system resumes operation.

As a result, after detecting deadlock, a method or way must be required to recover that deadlock in order to restart the system. The technique is known as deadlock recovery.

Here are various methods of deadlock recovery that we will discuss briefly in this tutorial.

Let's go over each of the three options for deadlock recovery one by one.

Deadlock Recovery through Preemption

The ability to take a resource away from a process, have another process use it, and then give it back without the process noticing It is highly dependent on the nature of the resource.

Deadlock recovery through preemption is too difficult or sometimes impossible.

Deadlock Recovery through RollBack

In this case of deadlock recovery through rollback, whenever a deadlock is detected, it is easy to see which resources are needed.

To recover from deadlock, a process that owns a needed resource is rolled back to a point in time before it acquired some other resource just by starting one of its earlier checkpoints.

Deadlock Recovery through Killing Processes

This method of deadlock recovery via killing processes is the most basic method of deadlock recovery.

Sometimes it is best to kill a process that can be restarted from the beginning with no ill effects.

Assume we have opened an app, say "Google Chrome," but while browsing, the browser may crash and stop working. And our system has reached a point where we are unable to do anything; thus, restarting your app is the best way to resolve this issue, followed by simply opening the task manager to terminate the process.

To do so, if you're on a Windows platform or using a Windows operating system, press "Alt+Ctrl+Del," then click the "Task Manager" button to open it. You can also access the task manager by pressing the "Windows" button, then typing "Task Manager" and pressing the "ENTER" key. For your convenience, here is a screenshot of the "Task Manager."

task manager deadlock kill process

To close an app or end a task, simply click on it and then click the "End Task" button at the bottom right of the window. I've taken another screenshot to demonstrate how to terminate an application. "Google Chrome," for example.

deadlock recovery task manager

I used the red arrow and the numbers 1 and 2 in the circle to emphasize that you must first click on the app, then on "End Task" to remove it from memory. You can now launch the same app as if it were new.

When it comes to deadlock recovery in the operating system, I believe that terminating and restarting is the most straightforward method.

Operating System Quiz


« Previous Topic Next Topic »


Liked this post? Share it!