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

What is the main advantage of the layered approach to system design? As in all cases of modular design, designing an operating system in a modular way has several benefits. Th

What are the services provided by the operating systems?  Program Development It provides a variety of services and facilities, such as debuggers and editor, to help the

Question: (a) Modern processors operate in one of two modes: one for the operating system and one for applications. What is the purpose of having these two modes? What are

In fixed portioning scheme, what are the advantages of using unequal- size partitions? With unequal-size partitions there are two probable ways to assign process to partitions.

Now, let us discuss two related algorithms for deciding which pages to evict. The clock algorithm is one of the most popular choices. It works by keeping frames in a circular struc

please help us to write a code in c for tree directory structures.

Cold Backup: It is copying the three groups of files when the object is shut down. This is a straight file copy, generally from the storage disk directly to tape. You must end th

Explain what ISAM is. Indexed sequential access method. The file is stored in sorted order. ISAM has a master index file, indicating in what part of another index file the key

The principle is that of ordinary addition; however remember the highest number is 1.   Calculate the following:                             11001 +                           11