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
Q. Define Input - Output operations? Serial lines, Disks, tapes and other devices should be communicated with at a very low level. The user require only specify the device and

What is a thread? A thread or else called a lightweight process (LWP) is a basic unit of CPU utilization, it comprises of a thread id, a program counter, a register set and a s

It uses unix commands such as forks and pipe .I need solution to this project

about error detection in operating system and how does it take place?

Q. Which of the subsequent programming techniques and structures are good for a demand-paged environment? Which aren't good? Describe your answers. a. Stack b. Hashed symbol


What advantages are there to this two-level directory? Users are isolated from each other. Users have more freedom in choosing file names.

A daemon is a process that removes itself from the terminal and disconnected, executes, in the background, waiting for requests and responding to them. It may also be described as

Some people write custom memory allocators to meet their speci?c needs. Although this is not needed for most of the applications, it is also not uncommon. The goal, of course, is t

Q. Explain the File-system manipulation? File-system manipulation there is several details in file allocation, creation, deletion and naming that users should not have to perfo