For Process
- Destroy a process: Although killing a process can solve our problem, choosing which process to kill is more important. The operating system typically terminates a process after it has completed the least amount of work.
- End all processes: Although not suggestible, this strategy can be used if the issue worsens significantly. Because each process will have to start from scratch after being killed, the system will become inefficient.
Recovery from Deadlock in Operating System
In today’s world of computer systems and multitasking environments, deadlock is an undesirable situation that can bring operations to a grinding halt. When multiple processes compete for exclusive access to resources and end up in a circular waiting pattern, a deadlock occurs. To maintain the smooth functioning of an operating system, it is crucial to implement recovery mechanisms that can break these deadlocks and restore the system’s productivity.
“Recovery from Deadlock in Operating Systems” refers to the set of techniques and algorithms designed to detect, resolve, or mitigate deadlock situations. These methods ensure that the system can continue processing tasks efficiently without being trapped in an eternal standstill. Let’s take a closer look at some of the key strategies employed.
There is no mechanism implemented by the OS to avoid or prevent deadlocks. The system, therefore, assumes that a deadlock will undoubtedly occur. The OS periodically checks the system for any deadlocks in an effort to break them. The OS will use various recovery techniques to restore the system if it encounters any deadlocks.
When a Deadlock Detection Algorithm determines that a deadlock has occurred in the system, the system must recover from that deadlock.