Explain about deadlocks, Operating System

Q. Explain about 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
What advantages are there to this two-level directory? Users are isolated from each other. Users have more freedom in choosing file names.

Define lazy swapper. Rather than swapping the entire process into main memory, a lazy swapper is used. A lazy swapper never swaps a page into memory unless that page will be ne

One reason to learn C and C++ is simply that so much software is written in these languages. A related, butmore fundamental reason, is that C and C++ are relatively low-level, allo

Computing uses three number bases:- Binary (base 2), Octal (base 8) and Hexadecimal (base 16). Binary has been described before, although various catchphrases are used to describe

Question: OS Installation / File system a) Why is NTFS portioning preferred over FAT16 or FAT32 when security is of primary concern? b) State a situation or an application w

Extend task 1 so that the requests are issued by the clients instead of the server. The server now do not use the "all_requests.dat" file. Instead every client thread reads from

Question: a. The following questions refer to a generic Windows file system: i) Describe what happens when you high-level format a floppy disk? ii) What is the maximum size

Define Server Processing with Queues The efficient server processing of client request is essential for optimized client- server applications. This process is greatly enhanced

Examining the write/cycles as shown below We can see that the bus is designed for asynchronous read/write cycles. The operation of the write cycle is simple in that the add

Q. Why is it important to scale up system bus and device speeds as the CPU speed increases? Answer: Consider a system which carries out 50% I/O and 50% computes. Doubling-up