Question:
What is a deadlock? How can it be identified?
2006-11-05 21:08:16 UTC
Explain with the help of example.
Three answers:
kapil
2006-11-05 21:49:43 UTC
For understanding the Deadlock

Lets consider the following example,

If suppose there are 3 processes like P1,P2,P3



Process P1 hold some resources and waiting for some other resources to free, which r hold by process P3.



same with Process P2 which is holding some resources and required other resources which r hold by process P1



Now process P3 required some resources which r hold by Process P2.



Now try to understand the situation,



Process P1 waiting for some resources which are hold by Process P3.

i.e P1 -> P3



Process P2 waiting for some resources which are hold by Process P1.

i.e P2 -> P1



Process P3 waiting for some resources which are hold by Process P2.

i.e P3 -> P2



In all every process is waiting for some other process to free some resources.

This situation is called deadlock.

I hope you got it........
manoj Ransing
2006-11-06 07:39:18 UTC
Deadlock are the situations where a set of processes are helding resources which are needed by other processes in same set. Because of this the processes which are helding resources blocked forever for the resources which are with other processes.

This can be simply explained by our own hindi movie examples.

Raj loves Priya, Priya loves Rahul, Rahul loves Simran, but now Simran loves Raj. In this situation no one will get anyobe untill one of them give the sacrifice.

Same situatoion may occur in computers. One process is holding printer and waiting to go in some portion of memory. At the same time another process is inside that memory portion and is waiting for printer. Both processes are blocked forever.

A deadlock can be identified by creating a graph of processes and reources. If this graph contains cycle, there is deadlock.
Mohit Sharma
2006-11-06 05:24:08 UTC
hi dhaval

deadlock is a situation when one or more processes(p1,p2) wait for a resource but that resource is being used by another process(p3) & that time p3 wants resources which has been already allocated to p1,p2 processes without releasing its previous resources that time p1,p2&p3 all are gone in waiting state &no process can complete.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...