Operating System - Deadlock Ignorance



In some situations, an operating system may simply prefer to ignore a deadlock completely as if it has no significance. This is considered as one of the four methods to handle deadlock in an operating system. In this chapter, we will discuss the concept of ignoring a deadlock in an operating system.

Deadlock Ignorance in Operating System

Deadlocks are so rare in modern operating systems that sometimes ignoring them altogether can be the best strategy. This approach can simplify system design and improve performance by avoiding the overhead associated with deadlock detection and recovery mechanisms.

The approach of ignoring deadlock is called the ostrich algorithm. This idea came from the myth that ostriches bury their heads in the sand to avoid a potential danger, an analogy for ignoring a problem in the hope that it will go away on its own.

When to Ignore a Deadlock

There are several reasons why some operating systems choose to ignore deadlocks −

  • Less likely to occur − If the systems is designed properly, the chances of deadlock occurring can be very low. At any stage if deadlock occurs, it can be resolved by simply restarting the system or terminating a few processes.
  • Cost of Prevention and Detection − The deadlock prevention and detection mechanisms can add significant overhead to the system. Sometimes, the cost of implementing these mechanisms may become higher than the cost of dealing with deadlock when it occurs.
  • Programmer Responsibility − In some systems, the programmers are needed to design their applications in a way that minimizes the chances of deadlock occurring. System will kill the process if it causes deadlock.
  • Non Critical Systems − Mostly, deadlock is ignored in non-critical systems like personal computers. Critical systems like banking systems, flight operating systems, etc., usually implement deadlock prevention or detection mechanisms.
  • Simplicity − Ignoring deadlock can simplify the design of the operating system.

When a Deadlock Can't be Ignored

A deadlock cannot be ignored all the time. In some situations, ignoring deadlock can lead to serious consequences like data corruption, system crashes, and loss of important information. For example, imagine a flight control system end up in a deadlock situation during mid air. The operating system will not respond and may lead to crash landing of the aircraft.

Following are some situations where a deadlock cannot be ignored −

  • Critical Systems − Critical systems are the systems where safety and reliability are important. For example, medical devices, aerospace systems, and financial systems. Here proper deadlock detection and recovery mechanisms must be implemented.
  • High Resource Utilization − If the system has high resource utilization, the chances of deadlock will also increase. In such cases, ignoring deadlock can lead to performance degradation and instability of the system.
  • Real-Time Systems − Real-time systems refer to the systems where tasks must be completed within a specific time frame. So there is no room for delays caused by deadlock. Therefore, real-time systems must implement deadlock prevention or avoidance mechanisms.
  • Long-Running Processes − In systems with long-running processes, the cost of deadlock can be significant. Therefore, these systems may choose to implement deadlock detection and recovery mechanisms.

Examples of Deadlock Ignoring Operating Systems

Many modern operating systems choose to ignore deadlock as a strategy for handling it. Some examples of such operating systems include −

  • Windows Operating System − Microsoft Windows operating system generally ignores deadlock. You might have seen messages like "The program is not responding" or "The application has stopped working" in your computer. These messages may indicate that a deadlock may have occurred. You can forcefully close the program or restart your computer to resolve the issue.
  • Linux Operating System − Linux operating system also follows the approach of ignoring deadlock. Similar to Windows, if a deadlock occurs, the system may become unresponsive. The user can terminate the process or restart the system.
  • macOS Operating System: Apple's macOS operating system also ignores deadlock similarly to Windows and Linux.

Conclusion

In this chapter, we highlighted the situations when a deadlock can simply be ignored by the system and also some situations when the system must take an action to recover from a deadlock.

Advertisements