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. Error detection in operating system? Error detection- Error detection take places at both the hardware and software levels. At the hardware level every data transfers must b

shell program for Armstrong number

What are the disadvantages of linked allocation? The drawbacks are a. Used only for sequential access of files. b. Direct access is not supported c. Memory space neede

Q. Why High level languages need Compiler? High level languages - illustrations are COBOL, FORTRAN, PL/I andALGOL - are processed by interpreters andcompilers. A compilers is a

importance of Operating system in modern computers. Also explain various functions & types of operating systems

What are the various process scheduling concepts? a) Scheduling queues with diagram b) Queuing diagram c) Schedulers d) Context switch with diagram

Question: In a deadlock, processes never finish executing and system resources are tied up, preventing other jobs from starting. Deadlocks can be characterised by a set of cond

explain hierarchical,hashed and inverted paging

What do you understand by “line balancing”? What happens if balance doesn’t exist?

A system consists of 10 units of resource class Ru. The resource needs of three user processes P1, P2 and P3 are like this                     Using Banker's algorithm, de