Search Topics....

Wednesday, August 17, 2011

What is Deadlock in Operating System ?


Deadlocks
In a multiprogramming environment, several processes may compete for a finite no.of resources. A process requests resources, if the resources are not available at that time, the process enters a wait state. it my happen that waiting process will never again change state, because the resources have requested are held up by other waiting processes. this situation is called Deadlock.
A deadlock state occurs when two or more processes are waiting indefinitely for an event that can be caused only by one of the waiting process.
A Deadlock situation may occur if and if four necessary conditions hold simultaneously in the system. namely mutual exclusion, hold and wait, no preemption and circular wait. 

Prevention of Deadlock.
To prevent deadlock we ensure that at lease of the necessary condition (namely mutual exclusion, hold and wait, no preemption and circular wait ) never holds.

Deadlock Avoidance 
Deadlock avoidance is less stringent than the prevention algorithm is to have priori information on how each process will be utilizing the resources.

Banker’s Algorithm
It is a Deadlock avoidance algorithm . This algorithm needs to know the maximum no.of each resource class that may be requested by each process.

No comments: