You are on page 1of 2

CHAPTER SEVEN:DEADLOCK

Definition Deadlock:In multiprogramming environment,several


processes may complete for a finite number resources.A process
request resources and the resources are not available at that time.the
process enters a waiting time.Sometimes a waiting process is never
again must be able to change state,because the resources it has
requested held by the other process,this situation is called a deadlock.

Under the normal mode of operation ,a process may utilize a resources


in only the following sequence.

1.Request:If the request can not be granted immediately.for example ,If


the resource is being used by another process.then the requesting
process must wait untile it can acquire the process.

2.Use:The process can operate on the resource.for example,If the


resource is a printer ,the process can print the printer.

3.Release:The process release the process.

Necessary condition

A deadlock situation can arise if the following four condition hold


simultaneously in a system.

1.Mutual exclusion:A lesast one resource must be held in a


nonshareable modfe,that is only one resources at a time can use the
resources.

2.Hold and Wait: A process must be holding at least one resource and
waiting to bacquire additional resource that are currently being held by
other process.
3.No Preemption:Resourse can not be preemptive.If only one resourse
can be release voluntarily by the holding proces.The process may
complete it tasks.

4.Circular Wait:A set<p1,p2, …. Pn> by waiting process must exists such


that a waiting process p1 by a resource type p2.a waiting process p2 by
aresourse type pn-1.a waiting process pn-1 by a resourse type pn.

You might also like