What is deadlock in operating system?

What is a deadlock in operating system? Is it a state where two ore more operations are waiting for each other, say a computing action 'A' is waiting for action 'B' to complete, while action 'B' can only execute when 'A' is completed. Such a situation would be called a deadlock. In operating systems, a deadlock situation is arrived when computer resources required for complete of a computing task are held by another task that is waiting to execute. The system thus goes into an indefinite loop resulting into a deadlock.

The deadlock in operating system seems to be a common issue in multiprocessor systems, parallel and distributed computing setups.


  • Pensu
    A deadlock is a situation when a process in the system has acquired some resources and waiting for more resources which are acquired by some other process which in turn is waiting for the resources acquired by this process. Hence, none of them can proceed and OS cant do any work.
  • Ankita Katdare
    Ankita Katdare
    what is a deadlock in operating system??
    One definition of an operating system is a resource allocator.

    There are many resources that can be allocated to only one process at a time.
    Sometimes a process has to reserve more than one resource. In general, resources allocated to a process are not preemptable; this means that once a resource has been allocated to a process, there is no simple mechanism by which the system can take the resource back from the process unless the process voluntarily gives it up or the system administrator kills the process. This can lead to a situation called deadlock.

    A set of processes or threads is deadlocked when each process or thread is waiting for a resource to be freed which is controlled by another process. Here is an example of a situation where deadlock can occur.

  • Ankita Katdare
    Ankita Katdare
    You should also note this -

    In order for deadlock to occur, four conditions must be true.
    • Mutual exclusion - Each resource is either currently allocated to exactly one process or it is available. (Two processes cannot simultaneously control the same resource or be in their critical section).
    • Hold and Wait - processes currently holding resources can request new resources
    • No preemption - Once a process holds a resource, it cannot be taken away by another process or the kernel.
    • Circular wait - Each process is waiting to obtain a resource which is held by another process.
  • vinci
    a process A needs some resource R1 which is acquired by some other process B,and process B needed some resource R2 ,which is acquired by process A.Hence none of the process acquired the required resource as both the respective process are in waiting condition and hence deadlock occurs.
  • PraveenKumar Purushothaman
    PraveenKumar Purushothaman
    Simple explanation:

  • Manish Goyal
    Manish Goyal
    Just think of a real time scenario

    A situation when brother are fighting for playing video game

    One brother has remote control for playing and other has game cd or whaever we call

    No only one person can play but both are not ready to cooperate and hence it results in deadlock, no one can play now, same is with operating system

    I hope this is very simple example to get a clear idea of deadlock,
  • lonniedivers
    A set of processes is deadlocked if each process in the set is waiting for an event that only another process in the set can cause including itself.
  • apple6
    In a multiprogramming environment, each & every process is waiting for the resources. These resources are held by other processes & the requesting process may enter a waiting state (sometimes it takes infinite time). Clearly, a deadlock can be defined as :
    "A set of processes is deadlocked, if each process in the set is waiting for an event that only another process in the set can cause (including itself)."

    Necessary Conditions for deadlock: Mutual exclusion
    Hold & wait
    No preemption
    Circular wait
    Eg: Traffic jam situation is the best example for deadlock.
  • Raman Mahajan
    Raman Mahajan
    Deadlock is a situation when two processes fight for the one resource in the system.
  • kamba giri
    kamba giri
    we can simply quote it as " when one process is executing no other process is allowed to execute at the same time. So when one process is under execution if another process requests for the execution then a deadlock state occurs".. and it should satisfy the four conditions
    1. Mutual exclusion.
    2. Hold and wait.
    3. No preumption.
    4. Circular wait.
    thats it.....
  • saurabh100
  • Prasad Ajinkya
    Prasad Ajinkya
    Oh you should totally look up the Dining Philosophers problem - Dining Philosophers Problem
  • Ankit Litoriya
    Ankit Litoriya
    Who can elaborate deadlock best . welcome all cE .............

    Who can elaborate deadlock best . welcome all cE .............
  • Kaustubh Katdare
    Kaustubh Katdare
    Ankit Litoriya
    Who can elaborate deadlock best . welcome all cE .............
    I've moved your post into an existing discussion on Deadlock in Operating Systems. Please see if you find what you're looking for in the posts above. ๐Ÿ˜€
  • Ankit Litoriya
    Ankit Litoriya
    You'll get all your questions answered here!


    ๐Ÿ˜’ If you have any specific doubt ask here
    Thanks bro..๐Ÿ‘๐Ÿ‘
  • Ankita Katdare
    Ankita Katdare
    For those studying deadlocks in operating systems, I believes these tutorials from IIT Professors will definitely help you out.

    I checked them and found that the professor - Mr. Satish Kashyap goes deep into the details to help you in understanding the concept of deadlocks in operating system in a clear concise format.

    My suggestion is that you sit with a notebook and pen and take down notes wherever possible by putting the video on 'pause', because the notes you will make can be later compared with the information written in books. There are a lot of deadlock related numericals in books intended for CS and IT students. These tutorials will also help you solve them.

    All the best!
  • ziuby
    A dead-lock is a situation in which two devices or computer programs sharing the same resource are effectively stopping each other from accessing the resource. Final result in both programs closing to function
    For details visit this website #-Link-Snipped-#
  • Stephen B Johnson
    Stephen B Johnson
    In a RTOS, you can get into a priority inversion too. I recall this affecting NASA with the Mars Pathfinder.
    This can seem like a case of deadlock.
  • Stephen B Johnson
    Stephen B Johnson
    Since nobody ever intends to encounter deadlock, there is a nice way some processor allow you to recover in case one is encountered.

    Using a hardware watchdog timer, you can at least automatically reset. This is especially important when the system is not accessible.

    If you're not familiar with a watchdog timer, then a quick read of it in a MPC8xx or MPC8xxx processor users manual would be worthwhile.

You are reading an archived discussion.

Related Posts

Join Europe's largest and most important hydrogen and fuel cells exhibition - the 18th Group Exhibit Hydrogen + Fuel Cells at HANNOVER MESSE 2012, April 23-27! HANNOVER MESSE attracts visitors...
I think it will be useful in quick way to have a forum which shares links (websites,youtube,etc.,) which are useful for different technical fields.
160By2 is a service that lets you send free SMS to India to any mobile network. The service claims that it's 12 million users and Out of the 160 characters...
LG - the leading TV company has launched world's biggest OLED screen Television. Apart from being drop dead gorgeous, the TV is, hold your breath, only 4 mm thick! ๐Ÿ˜จ...
dear sir/madam existing ground floor home, load bearing wall (no column,no beam) with R.C.C. flate roof (1) can it convert it into R.C.C. column,beam for upper floor (I mean first...