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
Since each thread has its own processing space therefore communication between threads will need to be done through a common global variable. Since multiple threads can access the


The Most comman difference are given below System calls are heavy. While a procedure call can generally be performed in a few system instructions, a system call needs the c

Define an assembly language  Assembly language stands for a Low level programming language

Basic File System Uses the specific device driver. Deals with blocks of data that are exchanged with the physical device. Concerned with the placement of blocks on

What are conditions under which a deadlock situation may arise? A deadlock situation can arise if the following four conditions hold simultaneously in a system: a. Mutual ex

linked allocation using i node

What is external fragmentation? As process are removed from and loaded to the memory free memory space is bracken into pieces .external fragmentation take place when enough mem

Q. Suppose an operating system maps user-level threads to the kernel utilizing the many-to-many model where the mapping is done through the use of LWPs. In addition the system allo

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