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
Define UNIX device driver The UNIX device driver is structured into two halves called top half and bottom half

Define Program preemption The Forced de-allocation of the CPU from a program which is executing on the CPU is known as Program preemption

What is an I/O subsystem? The control of devices connected to the computer is a main issue while designing operating systems. Because I/O deices differ widely in their function

GUI - Short for Graphical User Interface a GUI Operating System contains icons and graphics and is commonly navigated by using a computer mouse. Below are some instances of GUI Op

Discuss the high barriers to entry in the market for PL operating systems

What lead to the concept of paging? The main memory is separated into two parts that are one for the resident operating system, and one for the user processes. We may perhaps p

Compare between the one and two-dimensional memory organizations in terms of the  memory structure,  advantages, and disadvantages.  Which approach would better support the needs o


Explain the TlsGetValue (TLSindex) Function Executing this function will return the thread local storage data associated with this thread. The pointer returned will be the one

Define seek time and latency time. The time taken by the head to move to the appropriate cylinder or track is known as seek time. Once the head is at right track, it must wait