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 kernel? A more common explanation is that the OS is the one program running at all times on the computer  usually known as the kernel, with all else being applicati

Q. Multithreading is a commonly utilized programming technique. Illustrate three different ways that threads could be implemented. Describe how these ways compare to the Linux clon

Medium term scheduling is form of the swapping operation. This attaches to processes that are in a suspended or blocked state. They are swapped out of real-memory storage until t

Evicting the most-recently used (MRU) page does very well on LRU's worst case. In general, however, MRU is a bad idea, since many programs exhibit temporal locality in their memory

A hard-disk drive reads “120 GB HDD 7200 rpm 3 GB/sec transfer rate”. If the drive has a sector size of 512 bytes, what is the average rotational latency and transfer time to read

why we say " OS is a resource allocator" and “OS is a control program"?

explain any four types of operating system feature and structure(design)

Problem 1. What is kernel? What are the main components of a kernel? Defining Kernel Explaining Main components of Kernel 2. What is mutual exclusion? What are i

For reading, most operating systems use demand paging. This means that pages are only read from the disk into physical memory when they are needed. In the page table, there is a re

Question: (a) Red Hat Linux is distributed under the Open Source agreement. Explain what you understand by Open Source distribution system. (b) Write a short note on the L