Answer to Question #52533 in Programming & Computer Science for biruk

Question #52533
What are the necessary condition for a deadlock?
1
Expert's answer
2015-05-13T03:08:19-0400
Solution:

Deadlock Conditions

1. Mutual exclusion
Theresources involved must be unshareable; otherwise, the processes would not be
prevented from using the resource when necessary.
2. hold and wait or partialallocation
Theprocesses must hold the resources they have already been allocated while
waiting for other (requested) resources. If the process had to release its
resources when a new resource or resources were requested, deadlock could not
occur because the process would not prevent others from using resources that it
controlled.
3. No pre-emption
Theprocesses must not have resources taken away while that resource is being used.
Otherwise, deadlock could not occur since the operating system could simply
take enough resources from running processes to enable any process to finish.
4. Resource waiting or circularwait
Acircular chain of processes, with each process holding resources which are
currently being requested by the next process in the chain, cannot exist. If it
does, the cycle theorem (which states that "a cycle in the resource graph
is necessary for deadlock to occur") indicated that deadlock could occur.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS