19-10-2010, 10:35 AM
Deadlock
Topics
Deadlock Debrief
Simplest Example
Necessary Deadlock Conditions
Resource Allocation Graph
Deadlock Handling
Deadlock and Starvation with Semaphores
Examples
Deadlock
Simplest example:
Two processes require two resources to complete (and release the resources)
There are only two instances of these resources
If they acquire one resource each, they block indefinitely waiting for each other to release the other resource =>
DEADLOCK, one of the biggest problems in multiprogramming.
Necessary Deadlock Conditions
Recall which conditions must hold (p. 245):
ME: at least one process exclusively uses a resource
Hold and wait: a process possesses at least one resources and requires more, which are held by others
No preemption: resources are released only in voluntary manner by processes holding them
Circular wait: P1P2 P3 … PN P1
Resource-Allocation Graph
An easy way to illustrate resource allocation and visually detect the deadlock situation(s)
Example:
N+1 resources
N processes
Every process needs 2 resources
Upon acquiring 2 resources, a process releases them
Is there a deadlock?
For more information about this article,please follow the link;
http://alcor.concordia.ca/~sa_mokho/cour...adlock.ppt