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
A working Ubuntu Linux operating system.  You can use a Live-CD to complete this assignment. Create an empty text file named assignment6.txt in your home directory. Edit this

Swapping : Whole process is moved from the swap machine to the main memory for execution. Process size must be equal or less than to the used main memory. It is easier to exe

Define the Scheduling in Multitasking Earlier we learned the concepts and advantages of multitasking. In a system in which one or more tasks( threads or processes) attempt to s

Program of Calculator and Controller with the fork, exec, and wait system calls The objective of this assignment is to get you to be comfortable with the fork(), exec(), and wai

Operating Systems 1. Explain Micro-kernel? Specify the benefits of Micro-kernel? 2. Describe seven state process models used for OS with necessary diagram. Differentiate bet

Explain Rehashing to Handle Collision Rehashing:  Re-hashing schemes make use of a second hashing operation while there is a collision. If there is an additional collision, we

System Service Program system service program Supports and provides the services for other program. System service program perform Varity of tasks.  They are further divided in

File structure Certain files must conform to a needed structure that is understood by the operating system. The operating system may consist that an executable file has a parti

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

Briefly explain about file system implementation? Several on-disk and in-memory structures are used to execute a file system. On disk, the file system may have information abou