CrazyEngineers Archive
Old, but evergreen and popular discussions on CrazyEngineers, presented to you in read-only mode.
@aarthivg • 01 Jan, 2012
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 • 01 Jan, 2012 • 2 likes 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 • 02 Jan, 2012 • 6 likes
aarthivg
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.

gridlock
@Ankita Katdare • 02 Jan, 2012 • 2 likes 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 • 17 Feb, 2012 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 • 17 Feb, 2012 Simple explanation:

[​IMG]
or
[​IMG]
@Manish Goyal • 19 Feb, 2012 • 4 likes 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 • 22 Feb, 2012 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 • 10 May, 2012 • 2 likes 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 • 12 May, 2012 • 2 likes Deadlock is a situation when two processes fight for the one resource in the system.
@kamba giri • 17 May, 2012 • 1 like 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 • 13 Sep, 2012 😀
@Prasad Ajinkya • 14 Sep, 2012 Oh you should totally look up the Dining Philosophers problem - https://en.wikipedia.org/wiki/Dining_philosophers_problem
@Ankit Litoriya • 16 Jun, 2014 Who can elaborate deadlock best . welcome all cE .............

Who can elaborate deadlock best . welcome all cE .............
@Kaustubh Katdare • 16 Jun, 2014 • 1 like
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 • 16 Jun, 2014
Vishal0203
You'll get all your questions answered here!

https://lmgtfy.com/?q=deadlock in os

😒 If you have any specific doubt ask here
Thanks bro..👍👍
@Ankita Katdare • 10 Dec, 2015 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 • 10 Aug, 2016 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 Deadlock
@Stephen B Johnson • 13 Aug, 2016 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 • 13 Aug, 2016 • 2 likes 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.
71.8k views

Related Posts

@Kaustubh Katdare · Oct 23, 2008

The topic has been discussed many times elsewhere. Let's discuss it on CE Forums. Developing countries have bigger problems to deal with : Poverty, Education, Population Control, Infrastructure ... the...
4k views

@Ankita Katdare · Dec 10, 2013

As the HTC Desire brand becomes more and more popular in India, the ones who wan't an alternative to Samsung and Apple smartphones are fast opting for HTC's new range...
9k views

@dascolony · May 30, 2012

I am unable to reach to my friend. How can I find the current location of my friend's mobile? Please help me out!!!
3.7k views

@Ankita Katdare · Dec 6, 2013

Logitech India, the company bringing computer peripherals is here with an exciting new product. It's the Logitech G440 and G240 Gaming Mouse Pads. A hard-core gamer knows how important it...
6.8k views

@mindstunner · Jan 25, 2011

I need an powerpoint presentation on " applications of fluid mechanics " can anyone give me a ppt on this , its very urgent i dont have time to make...
3.7k views