Deadlock Detection And Recovery

Last Updated :

Deadlock Detection and Deadlock recovery are important tasks of OS. If deadlocks are not avoided, then another approach is to detect when they have occurred and recover somehow.

These are explained as following below.

1. Deadlock Detection :

  1. If resources have single instance :
    If cycle exist in the Resource Allocation Graph, then there exist deadlock in the system. That means, Presence of cycle in the Resource Allocation Graph is the sufficient condition for deadlock.

  2. If there are multiple instances of resources :
    If cycle exist in the Resource Allocation Graph, then there deadlock may possible in the system. That means, Detection of the cycle in the Resource Allocation Graph is necessary but not sufficient condition for deadlock detection.
    In this case, the system may or may not be in deadlock varies according to different situations.

2. Deadlock Recovery :
In order to recover the system from deadlocks, either OS considers resources or processes.

  • Killing the process :
    killing all the process involved in the deadlock. Killing process one by one.
  • Resource Preemption :
    Resources are preempted from the processes involved in the deadlock, preempted resources are allocated to other processes. In this, there may be chance of starvation of a low priority process.



Please write comments if you find anything incorrect. A gentle request to share this topic on your social media profile.

Comment
Next Article
CPP_Programmer Published 13 Sep, 2020 · 2 min read

Similar Reads

  • Software concepts of Computer

    Before starting the software concepts, let us take a brief look into the components of computer. Components of Computer: A computer system has 3 components namely: Hardware, Software,…

    3 min read
  • Difference between Full Virtualization and Para-virtualization

    Process of abstracting underlying hardware components from software is the primary concept behind virtualization. 1. Full Virtualization In full virtualization, a single host operating system allows the execution…

    2 min read
  • Storage Structure memory

    Storage structure consists of registers, main memory, and magnetic disk is only one of many possible storage systems. There are also cache CD ROM, magnetic takes, and so…

    3 min read
  • What is Software and its Types ?

    Software is nothing but a program or collection of programs that perform a specific task. Software is a bridge between user and computer hardware. Softwares directs the peripheral…

    1 min read
  • Searching in parent and printing result in child processes using fork()

    In C/C++, the fork() function is used to generate a new process known as the child process. We can do searching within a fork() process. Problem statement –…

    3 min read
  • Multilevel Paging in Operating System

    A page table is a data structure used by virtual memory system in a computer operating system to store the mapping between the virtual addresses and physical addresses.…

    4 min read