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
explain about design issues of network operating system

With software algorithms for mutual exclusion, such as Dekker's algorithm, Peterson's algorithm, or Lamport's bakery algorithm, note that optimizing compilers and out-of-order exec

Q. Explain about Error detection method? Error detection: error can occur in CPU, in I/O devices or in memory hardware. Operating system constantly needs to be aware of possi

Inverted page table In page table the page table has one entry for every page that the process is using. The operating system must translate this reference into a physical memo

Here are the conditions necessary for a deadlock to occur; note that all of them are necessary, and none is suf?cient: 1. ?nite resources: the resources are held in a mutually-e

How could we implement locks? No matter how we choose to implement them, we must have some hardware support. One possibility for implementing locks on a uniprocessor machine is is

how response times are reduced by allowing time sharing on top of multiprogramming

Q. Several CPU-scheduling algorithms are parameterized for instance the RR algorithm requires a parameter to indicate the time slice. Multilevel response queues require parameters

Define the Server Communications Module or SCM The Server Communications Module (SCM) performs many necessary functions. The SCM responsible for establishing, maintaining, and

1. What must a kernel provide for an effective user-level thread implementation? 2. With respect to the quantum q in a scheduling algorithm, explain and discuss the impact of th