Hunt for India's Best Academic Project (Applications Open)

Mega project competition for all THIRD and FINAL year engineering students in India. Prizes worth Rs. 80,000+ are ready to be won!


Deadline For Round I: March 10, 2015.


Click: Read Contest Details || Click: To Submit Your Entry


Click: Check Short Listed Entries [Updated Daily Till March 15th]

What is deadlock in operating system?

Discussion in 'Computer Science | IT | Networking' started by aarthivg, Jan 1, 2012.

  1. aarthivg

    aarthivg Ace

    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.
  2. Pensu

    Pensu Star

    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.
    • Like Like x 1
  3. Ankita Katdare


    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.

    • Like Like x 5
  4. 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.
    • Like Like x 1
  5. vinci

    vinci Apprentice

    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.
  6. Praveen-Kumar

    Praveen-Kumar Knight

    Simple explanation:

  7. 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,
    • Like Like x 3
  8. lonniedivers

    lonniedivers Certified CEan

    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.
  9. apple6

    apple6 Certified CEan

    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.
    • Like Like x 2
  10. Raman Mahajan

    Raman Mahajan Certified CEan

    Deadlock is a situation when two processes fight for the one resource in the system.
    • Like Like x 1
  11. kamba giri

    kamba giri Certified CEan

    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.....
  12. saurabh100

    saurabh100 Certified CEan

  13. Who can elaborate deadlock best . welcome all cE .............

    Who can elaborate deadlock best . welcome all cE .............
    #14 Ankit Litoriya, Jun 16, 2014
    Last edited by a moderator: Jun 16, 2014
  14. Kaustubh Katdare


    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. :)
    • Like Like x 1
  15. Vishal0203

    Vishal0203 Maniac

    You'll get all your questions answered here!

    :rolleyes: If you have any specific doubt ask here
    • Like Like x 1

Share This Page