Deadlock prevention, Operating System

While it is hard to resolve a deadlock which has been detected, fortunately it is fairly easy to prevent deadlocks from ever happening. The key is that the conditions above for deadlock are all necessary. We just have to ensure that at least one condition cannot be true. We de?nitely cannot get rid of the problem of ?nite resources; that is something we have to live with. And in many cases it can be dif?cult to get rid of the conditions of hold-and-wait and lack of preemption.

But we can eliminate circular waiting. One standard way of doing this is to have a so-called canonical ordering of the locks. This means that the programmer must always acquire the locks in a speci?ed order, such as ?rst lock1, then lock2, then lock3, etc. By doing so, we will ensure a system whose thread/resource graph is cycle-free, and therefore the system will be deadlock-free.

Posted Date: 3/12/2013 5:32:31 AM | Location : United States







Related Discussions:- Deadlock prevention, Assignment Help, Ask Question on Deadlock prevention, Get Answer, Expert's Help, Deadlock prevention Discussions

Write discussion on Deadlock prevention
Your posts are moderated
Related Questions
Q. Presume that a scheduling algorithm at the level of short-term CPU scheduling favours those processes that have used the least processor time in the recent past. Why this algori

What is degree of multiprogramming ? Degree of multiprogramming signifies the number of processes in memory. If the degree of Multiprogramming is steady after that the average

What is graceful degradation? In multiprocessor systems, failure of single processor will not halt the system, but only slow it down by sharing the work of failure system by ot

A friend has promised to log in at a particular time. However, he needs to be contacted as soon as he logs in. The shell script checks after every minute whether he has logged in o

What are the phases of background processing? Phases are:- Job Scheduling. Job Processing. Job Overview.

RESOURCE ALLOCATION GRAPH When a process Pi wishes an instance of resource type Rj, a request edge is inserted in the resource allocation graph. When this request is able to be

Deadlock Avoidance It's a method to evade deadlock by careful resource scheduling. This approach to the deadlock problem foresees deadlock before it actually occurs. This a

example of first fit best fit and worst fit

Write a note on semaphores A semaphore is a tool meant for synchronizing multiple processes trying to access a shared variable. That is a semaphore is used to deal with the cri

Q. Describe the purpose of the open() and close() operations. Answer: The open() operation notifies the system that the named file is about to become active. The c