The Wayback Machine - https://web.archive.org/web/20240914132315/https://www.geeksforgeeks.org/deadlock-ignorance-in-operating-system/
Open In App

Deadlock Ignorance in Operating System

Last Updated : 15 Apr, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

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.

Ignoring the possibility of deadlock in operating systems can have both advantages and disadvantages.

Advantages:

  1. Simplicity: Ignoring the possibility of deadlock can make the design and implementation of the operating system simpler and less complex.
  2. Performance: Avoiding deadlock detection and recovery mechanisms can improve the performance of the system, as these mechanisms can consume significant system resources.

Disadvantages:

  1. Unpredictability: Ignoring deadlock can lead to unpredictable behavior, making the system less reliable and stable.
  2. System crashes: If a deadlock does occur and the system is not prepared to handle it, it can cause the entire system to crash, resulting in data loss and other problems.
  3. Reduced availability: Deadlocks can cause processes to become blocked, which can reduce the availability of the system and impact user experience.
    In general, the disadvantages of ignoring deadlock outweigh the advantages. It is important to implement effective deadlock prevention and recovery mechanisms in operating systems to ensure the stability, reliability, and availability of the system.

Previous Article
Next Article

Similar Reads

Difference between Deadlock Prevention and Deadlock Avoidance
1. Deadlock Prevention : Deadlock prevention means to block at least one of the four conditions required for deadlock to occur. If we are able to block any one of them then deadlock can be prevented. The four conditions which need to be blocked are:- Mutual ExclusionHold and WaitNo PreemptionCircular Wait Spooling and non-blocking synchronization a
2 min read
Conditions for Deadlock in Operating System
A deadlock is a situation where a set of processes is blocked because each process is holding a resource and waiting for another resource acquired by some other process. In this article, we will discuss what is deadlock and the necessary conditions required for deadlock. What is Deadlock?Deadlock is a situation in computing where two or more proces
8 min read
Deadlock Detection Algorithm in Operating System
In operating systems, managing resources like memory, files, and processors is very important. Sometimes, processes (or programs) get stuck waiting for each other to release resources, leading to a situation called a deadlock. To handle deadlocks, operating systems use special methods called deadlock detection algorithms. These algorithms help iden
7 min read
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 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 imple
8 min read
Introduction of Deadlock in Operating System
A deadlock is a situation where a set of processes is blocked because each process is holding a resource and waiting for another resource acquired by some other process. In this article, we will discuss deadlock, its necessary conditions, etc. in detail. What is Deadlock?Deadlock is a situation in computing where two or more processes are unable to
11 min read
Deadlock System model
Overview :A deadlock occurs when a set of processes is stalled because each process is holding a resource and waiting for another process to acquire another resource. In the diagram below, for example, Process 1 is holding Resource 1 while Process 2 acquires Resource 2, and Process 2 is waiting for Resource 1. System Model : For the purposes of dea
8 min read
System Protection in Operating System
Introduction: System protection in an operating system refers to the mechanisms implemented by the operating system to ensure the security and integrity of the system. System protection involves various techniques to prevent unauthorized access, misuse, or modification of the operating system and its resources. There are several ways in which an op
3 min read
User View Vs Hardware View Vs System View of Operating System
User View of Operating System: The Operating System is an interface, hides the details which must be performed and present a virtual machine to the user that makes it easier to use. Operating System provides the following services to the user. Execution of a programAccess to I/O devicesControlled access to filesError detection (Hardware failures, a
1 min read
Xv6 Operating System -adding a new system call
Prerequisite - Xv6 Operating System -add a user program In last post we got to know how to add user program in Xv6 Operating System. Now here you will see how to add new system call in Xv6 Operating System. A dding new system call to xv6: A system call is way for programs to interact with operating system. A computer program makes system call when
6 min read
Traps and System Calls in Operating System (OS)
Traps and system calls are two mechanisms used by an operating system (OS) to perform privileged operations and interact with user-level programs. Here is an overview of each mechanism: Traps: A trap is an interrupt generated by the CPU when a user-level program attempts to execute a privileged instruction or encounters an error. When a trap occurs
3 min read
Difference between System Software and Operating System
1. System Software: System software is a type of computer program that is designed to run a computer's hardware and application programs it controls a computer's internal functioning, chiefly through an operating system. It also controls peripherals devices such as monitors, printers, and storage devices. 2. Operating System: An operating system or
3 min read
Fork System Call in Operating System
In many operating systems, the fork system call is an essential operation. The fork system call allows the creation of a new process. When a process calls the fork(), it duplicates itself, resulting in two processes running at the same time. The new process that is created is called a child process. It is a copy of the parent process. The fork syst
5 min read
System Programs in Operating System
System Programming can be defined as the act of building Systems Software using System Programming Languages. According to Computer Hierarchy, Hardware comes first then is Operating System, System Programs, and finally Application Programs. Program Development and Execution can be done conveniently in System Programs. Some of the System Programs ar
3 min read
File System Implementation in Operating System
A file is a collection of related information. The file system resides on secondary storage and provides efficient and convenient access to the disk by allowing data to be stored, located, and retrieved. File system implementation in an operating system refers to how the file system manages the storage and retrieval of data on a physical storage de
11 min read
Chandy-Misra-Haas's Distributed Deadlock Detection Algorithm
Chandy-Misra-Haas's distributed deadlock detection algorithm is an edge chasing algorithm to detect deadlock in distributed systems. In edge chasing algorithm, a special message called probe is used in deadlock detection. A probe is a triplet (i, j, k) which denotes that process Pi has initiated the deadlock detection and the message is being sent
4 min read
Relation Between Number of Processes and Number of Resources to Prevent Deadlock
A set of blocked processes where each process is holding some resource and waiting to acquire some other resource held by another process in the set. This situation is called deadlock in the operating system. Deadlock can be prevented if the number of resource instances in a system is significantly larger than the number of processes asking for a r
3 min read
Deadlock Prevention And Avoidance
When two or more processes try to access the critical section at the same time and they fail to access simultaneously or stuck while accessing the critical section then this condition is known as Deadlock. Deadlock prevention and avoidance are strategies used in computer systems to ensure that different processes can run smoothly without getting st
6 min read
Deadlock Detection And Recovery
Deadlock Detection and Recovery is the mechanism of detecting and resolving deadlocks in an operating system. In operating systems, deadlock recovery is important to keep everything running smoothly. A deadlock occurs when two or more processes are blocked, waiting for each other to release the resources they need. Detection methods help identify w
6 min read
Deadlock, Starvation, and Livelock
Prerequisite - Deadlock and Starvation  Livelock occurs when two or more processes continually repeat the same interaction in response to changes in the other processes without doing any useful work. These processes are not in the waiting state, and they are running concurrently. This is different from a deadlock because in a deadlock all processes
6 min read
Difference between Deadlock and Starvation in OS
Deadlock is a condition wherein all the processes are holding one resource each and are waiting for another process to release another resource. Starvation is a state that prevents lower-precedence processes from getting the resources. Starvation arises when procedures with critical importance keep on utilizing the resources frequently. Therefore,
7 min read
Banker's Algorithm in Operating System
Prerequisite - Resource Allocation Graph (RAG), Banker’s Algorithm, Program for Banker’s Algorithm Banker's Algorithm is a resource allocation and deadlock avoidance algorithm. This algorithm test for safety simulating the allocation for predetermined maximum possible amounts of all resources, then makes an “s-state” check to test for possible acti
15 min read
Swap Space in Operating System
A computer has a sufficient amount of physical memory but most of the time we need more so we swap some memory on disk. Swap space is a space on a hard disk that is a substitute for physical memory. It is used as virtual memory which contains process memory images. Whenever our computer runs short of physical memory it uses its virtual memory and s
6 min read
Thread Models in Operating System
A thread is a light weight process which is similar to a process where every process can have one or more threads. Each thread contains a Stack and a Thread Control Block. There are four basic thread models : 1. User Level Single Thread Model : Each process contains a single thread.Single process is itself a single thread.process table contains an
2 min read
The Tempo Operating System
Operating system : An Operating system is an interface between the computer user and computer hardware. An Operating system is a software which performs all the basic task like file handling, file management, memory management, handling input and output, controlling peripherals devices such as disk drive and printer, mouse...etc Tempo operating sys
5 min read
Boot Block in Operating System
Basically for a computer to start running to get an instance when it is powered up or rebooted it need to have an initial program to run. And this initial program which is known as bootstrap needs to be simple. It must initialize all aspects of the system, from CPU registers to device controllers and the contents of the main memory, and then starts
5 min read
Comparison on using Java for an Operating System instead of C
Java is a managed language which offers memory safety. In Java, pointers do not exist, so we cannot do pointer arithmetic on a function pointer. An application can invoke a method defined in a class through the class object. In Java, we cannot do unsafe typecast of an object to overwrite the method pointer with something else. An out of bound array
2 min read
Difference between Loading and Linking in Operating System
An operating system acts as an intermediary between the user of a computer and computer hardware. The purpose of an operating system is to provide an environment in which a user can execute programs conveniently and efficiently. Linking and Loading are utility programs that play an important role in the execution of a program. Linking intakes the o
4 min read
Difference between Operating System and Kernel
Operating System: It is a system program that provides interface between user and computer. When computer boots up Operating System is the first program that loads. Kernel: A kernel is the core component of an operating system. It is also a system program. It is the part of Operating System which converts user commands into machine language. Differ
2 min read
Stack Implementation in Operating System uses by Processor
A stack is an associate ordered a set of components, only one of that (last added) are often accessed at a time. The point of access is named the highest of the stack. The number of components within the stack, or length of the stack, is variable. Items could solely be side to or deleted from the highest of the stack. For this reason, a stack is ad
4 min read
Best-Fit Allocation in Operating System
INTRODUCTION: Best-Fit Allocation is a memory allocation technique used in operating systems to allocate memory to a process. In Best-Fit, the operating system searches through the list of free blocks of memory to find the block that is closest in size to the memory request from the process. Once a suitable block is found, the operating system spli
4 min read