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
DIFFERENT MULTITHREADING MODELS Multithreading Models the majority multithreading models fall into one of the following categories of threading implementation: 1.      M

Question: A set of processes are in a deadlock state when every process in the set is waiting for an event that can be caused by only another process in the set. (a) There

In this project, you will implement the Chandy and Misra's (CM) algorithm using POSIX Threads (Pthreads).   The algorithm  is a distributed algorithm to solve a generalized dining

Which android version is available till now

Question : (a) In the demand paging system, when a process tries to access a page that was not brought into memory, a page fault occurs that involves a series of actions. The

SEGMENTATION HARDWARE An execution to map two-dimensional user-defined addresses into one-dimensional physical addresses. This mapping is affected by means of segment table. Ev

What is the purpose of the command interpreter? Why is it usually separate from the kernel? It reads commands from the user or from a file of commands and executes them, usuall

Explain the concept of Reentrancy? It is a useful, memory-saving method for multiprogrammed timesharing systems. A Reentrant Procedure is one in which many users can share a si

Your task is to replace the round robin CPU scheduling scheme you developed in Practical 6 with a priority-based scheduling algorithm. To simplify matters, you can maintain the ori

Problem 1. List out the conditions that result in Deadlock situations. Illustrate deadlock situation with a simple graphical notation Listing conditions for deadlock occu