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
TII stands for The abbreviation of TII is Table of incomplete instructions.

Why is rotational latency usually not considered in disk scheduling? How would you modify SSTF, SCAN, and C-SCAN to include latency optimization? Most disks do not export their

Perform alpha-beta pruning on the following tree. Put an "X" over each node that is pruned. Put the final value next to all other nodes. Indicate which action MAX should take: to B

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 dea

Determine the syntax of the Fork and Join Primitive  Answer: Syntax of the Fork and Join Primitive is as follow: Fork Join

Compare user threads and kernel threads. User threads:- User threads are supported above the kernel and are executed by a thread library at the user level. Thread creation

Forking is an important phase of Unix, critical to the support of its design strategies, which encourages the implementation of filters. In Unix, a filter is a process that reads i

In a multiprogramming and time sharing environment several users share the system simultaneously .what are two such problems?

The following is a dump of a TCP header in hexadecimal format: 00CD0018 00000EF1 00000D5D 502200D1 01BF0010 We need to first split the above hex as such 00 CD 00 18 00 00

Explain root partition The root partition,which have the operating-system kernel and potentially other system files, is mounted at boot time. In successful mount operation, ope