Explain about deadlocks, Operating System

Assignment Help:

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.


Related Discussions:- Explain about deadlocks

Explain schemes for defining the logical structure, What are the most commo...

What are the most common schemes for defining the logical structure of a directory? The most common schemes for explaining the logical structure of a directory Single-L

Ipc, Explain in detail about ipc in linux

Explain in detail about ipc in linux

Assembly, Write a program that will input two numbers from the keyboard and...

Write a program that will input two numbers from the keyboard and execute each of the signed and unsigned multiply and divide instructions. For each instruction, the program shoul

Write a note on semaphores, Write a note on semaphores A semaphore is a...

Write a note on semaphores A semaphore is a tool meant for synchronizing multiple processes trying to access a shared variable. That is a semaphore is used to deal with the cri

Introduction to paging, We will brie?y introduce paging to ?nish off this l...

We will brie?y introduce paging to ?nish off this lecture. When a process is loaded, not all of the pages are immediately loaded, since it's possible that they will not all be need

Microsoft, Discuss the high barriers to entry in the market for PL operatin...

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

Designing issues in a network -transparency, Transparency Users mus...

Transparency Users must be able to access remote resources as though these resources were local. Transparency should as well promote user mobility. Users must be allowed

Define the sleep (sec) function, Define the Sleep (sec) Function Sleep ...

Define the Sleep (sec) Function Sleep function suspends execution of this process for sec number of seconds. While this function is used in our example for consistency, other f

Write a brief note on demand paging, Write a brief note on demand paging. ...

Write a brief note on demand paging. A demand paging is alike to a paging system with swapping. The Processes reside on the secondary memory while we want to implement a proces

What is an i/o subsystem?, What is an I/O subsystem? The control of dev...

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

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd