Explain about deadlocks, Operating System

Q. Explain about Deadlocks?

Deadlocks

for (int i = 0; i < n; i++) {

// first find a thread that can finish

for (int j = 0; j < n; j++) {

if (!finish[j]) {

boolean temp = true;

for (int k = 0; k < m; k++) {

if (need[j][k] > work[k])

temp = false;

}

if (temp) { // if this thread can finish

finish[j] = true;

for (int x = 0; x < m; x++)

work[x] += work[j][x];

}

}

}

}

At present there are two resources available. It is an system is in an unsafe state as process P1 could complete thereby freeing a total of four resources. But we can't guarantee that processes P0 and P2 can complete. Nevertheless it is possible that a process may release resources before requesting any further. For instance process P2 could release a resource thereby increasing the total number of resources to five. This permit process P0 to complete which would free a total of nine resources thereby allowing process P2 to complete as well.

Posted Date: 7/27/2013 4:01:01 AM | Location : United States







Related Discussions:- Explain about deadlocks, Assignment Help, Ask Question on Explain about deadlocks, Get Answer, Expert's Help, Explain about deadlocks Discussions

Write discussion on Explain about deadlocks
Your posts are moderated
Related Questions
Essential Properties of Operating System 1. Batch: Jobs with similar needs are batched together and run through the computer as a group by an operator or automatic job sequen

Is it probable to have a deadlock involving only one single process? Describe your answer. Answer: No This pursue directly from the hold-and-wait condition.

FIFO is named as 'named pipes'. FIFO (first-in-first-out) is a special file which is laid to be data transient. Once data is load from named pipe, it cannot be load again. Also, da

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

What is Belady's anomaly When plotting on a graph the page faults versus the number of available frames. We notice that the number of faults for four frames is greater than th

Ask using a laballed diagram explaining the architecture of windows operating ststem

Determine a component of a process precedence sequence Process name, Sequence operator ‘;’ and Concurrency operator ‘,’

What are the three main activities of an operating system in regard to memory management? Keep track of which parts of memory are now being used and by whom. Decide which pr

LINUX VS WINDOWS I/O MANAGEMENT

Multi-level page tables are tree-like structures to hold page tables. As an example, consider a two- level page table, again on a 32-bit architecture with 212 = 4 kbyte pages. Now,