English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Explain with the help of example.

2006-11-05 16:08:16 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

3 answers

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

2006-11-05 16:49:43 · answer #1 · answered by kapil 1 · 0 0

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.

2006-11-06 02:39:18 · answer #2 · answered by manoj Ransing 3 · 0 0

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.

2006-11-06 00:24:08 · answer #3 · answered by Mohit Sharma 1 · 0 0

fedest.com, questions and answers