You are on page 1of 1

Operating System

Dead Lock
Dead Lock is problem or situation when 2 process sharing the same resources are
effectively preventing each other from accessing the resources.

R1

P1 P2

R2

A graph Model: we use a directed graph model to capture the sense of deadlock.
There are two kind of nodes.
i.Circles  denote process
ii.Squares  denote resources
A directed arc from a process node(circle) to a resource node(square) denoted that the
process needs that resource to proceed with its execution.
A directed arc from a square to a circle denotes that the resource is held by that
process.
Deadlock occurs when the following conditions.
1.Mutual Execlution  each resource can be assigned to at most one process only.
2.Hold and Wait  process hold a resource and wait for a additional resource.
3.No Preemption  a resource can be voluntarily by process itself.
4.Circular wait  every process awaits release of atleast one resource held by some
other processes.
A deadlock requires above four conditions to occur at the same time.

You might also like