Everything2
Near Matches
Ignore Exact
Full Text
Everything2

Deadlock prevention

created by knar

(thing) by knar (1.4 y) (print)   ?   (I like it!) Wed Dec 19 2001 at 14:48:46

One of the three basic methods to treat deadlock. The other two are deadlock avoidance and deadlock detection.

Deadlock prevention consists on imposing restrictions on the requests the processes may do in order to make it impossible for a deadlock situation to happen. Deadlock will be impossible if we never reach any of its four preconditions: mutual exclusion, hold and wait, non preemption and circular wait. Normally, mutual exclusion can't be avoided, because each instance of a resource can only be used by one process. However, the other three conditions can be avoided as follows:

Hold and wait: Either force processes to request all the resources at once (preallocation) or force processes to free all the resources they have allocated before asking for more. The first solution causes low resource usage, the second may cause process starvation.

Non preemption: If a request can't be satisfied because there aren't enough free resources, remove all the resources currently allocated by the process which made the request and put the process to sleep until both the resources it previously had and the ones requested are free. This solution may cause starvation.

Circular wait: Assign an ID number to each resource type. A process can't request a resource if it already has allocated resources with a bigger ID number. This solution doesn't cause starvation or low resource usage, but it's not very "programmer-friendly".


printable version
chaos

Deadlock I have dreadlocks and I don't know where the pot is Study Avoidance Equation taboo avoidance
scroll of food detection Salisbury buffer deadlock Relapse
static starvation Escape and Avoidance learning zone of avoidance
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Nodes to live by:
Why you do not want to work for an Ad Agency
Speed exercises for guitar
Tecumseh's Curse
This freaking obsession with really abysmal porn
High Society
viral marketing
Dragging a disk to the trash to eject it on a Macintosh
My correspondence with the Westboro Baptist Church
KGB
World War II
MIT Guide to Lockpicking
Keyboards in a computer lab with very sticky keys that make you
Suburban Stigmata
New Writeups
Meezzio
Gotlandssnus(thing)
argv
Astral Plane(idea)
Madara
One Winged Angel(fiction)
Tom Rook
Talk is cheap(poetry)
shaogo
Adelle Davis(person)
Aerobe
race car g sfjsgsd(poetry)
Binah
Dream Log: July 5, 2008(dream)
StrawberryFrog
Forgotten things in space(idea)
antigravpussy
velvet revolution fairy tale(idea)
Heitah
Nerve agent VX(thing)
Pavlovna
shite(idea)
wonton
Days and nights come together in a slow falling down(fiction)
Pavlovna
wee(idea)
katherine
root log: July 2008(log)
Madara
There’s nothing like a trail of blood to find your way back home(fiction)
This affordable entertainment brought to you by The Everything Development Company