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 the ThreadSwitch function used in the netware Since NetWare 3 and 4 are nonpreemptive environments, it may be necessary for the application developer to explicitly reli

List sample file types, based on use, on the VAX under VMS.  source programs (.BAS, .FOR, .COB, .PLI, .PAS, .MAR)  data files (.DAT)  text files (.TXT)  command proced

Q. Provide two programming instances in which multithreading provides better performance than a single-threaded solution. Answer: (1) A Web server that services every request

Write short note on recovery regarding the file system in Windows 2000. In many file systems a power breakdown at the wrong time can damage the file system data structures so s

Define the TlsFree(TLSIndex) Function This function should be called to free a TLSindex allocated by TlsAlloc. It would be executed when there are no more threads in a process


What is sector sparing is proper definition

Determine the task of the Pass II In a two-pass assembler Synthesize the target program is the task of the Pass II

Partitions and mounting A disk can be sliced into many partitions, or a partition can span multiple disks. Every partition can be either "raw", having no file system, or "cooke

What factors are involved in choosing the host operating system?