Skip to content
Related Articles

Related Articles

Deadlock Ignorance in Operating System

Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 16 Jun, 2022
Improve Article
Save Article

In this article we will study in brief about what is Deadlock followed by Deadlock Ignorance in Operating System.

What is Deadlock?  

If each process in the set of processes is waiting for an event that only another process in the set can cause it is actually referred as called Deadlock. In other words, one event which has to happen by one process with the presence of another process in the process set, this situation is referred as Deadlock.

Let us understand the above illustrated definition of Deadlock with the help of an example shown in below section.

Example of a Deadlock:
Suppose process A holds resource C and process B holds resource D. Now process A request for resource D and process B request for resource C but none of the process will get these resources as both the resources are already busy with some other process hence neither of them can proceed further. This situation is called Deadlock. 

After analyzing deadlock with the help of an example (shown above), let us see the four necessary condition which may lead to deadlock, shown in below illustrated section.

Necessary conditions for Deadlock:

There are 4 conditions which leads to Deadlock. They are as follows: 

  1. Mutual exclusion condition 
  2. Hold and wait condition 
  3. No preemption condition
  4. Circular wait condition

All the above four condition should be present for deadlock to occur. If any of the above illustrated conditions fails to happen, then we may conclude that there is no deadlock in the system.

Deadlock Ignorance : 
Stick your head in the sand and pretend there is no problem at all, this method of solving any problem is called Ostrich Algorithm. This Ostrich algorithm is the most widely used technique in order to ignore the deadlock and also it used for all the single end-users uses. If there is deadlock in the system, then the OS will reboot the system in order to function well. The method of solving any problem varies according to the people. 

Scientists all over the world believe that the most efficient method to deal with deadlock is deadlock prevention. But the Engineers that deal with the system believe that deadlock prevention should be paid less attention as there are very less chances for deadlock occurrence. 

System failure, compiler error, programming bugs, hardware crashes that occur once a week should be paid more attention rather than deadlock problem that occur once in years. Therefore most of the engineers don’t pay much amount in eliminating the deadlock. 

Many operating systems suffers from deadlock that are not even detected and then automatically broke. Just as an explanation we know that the number of processes is determined by the process table. Now as we know there are only finite number of slots in the process table and hence when the table is full the fork fails. Now the reasonable approach for the new fork has to wait and try again when the slot in the process table is empty. 

Also, such problem is noticed while opening and closing file. The maximum time the file is opened is restricted and mention in the i-node table and thus similar problem is observed when the table is filled. Another limited resource is mentioned as swap space. In fact, all the table storing data in the operating system has finite resource limit. It might happen that a collection of n processes might each claim 1/n of the total, Should we clear all of these and then each try to claim another one? 

Including UNIX and WINDOWS, all the operating system ignore the deadlock first assuming that the user is restricted to one process. The deadlock ignorance comes into picture frequently because by this method deadlock is eliminated for free rather than spending much on other deadlock prevention methods also putting some inconvenient restrictions on process. Thus we have to decide between the correctness and convenience between the different methods of solving the deadlock.

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!