Explain about deadlocks, Operating System

Assignment Help:

Q. Explain about 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 the various methods of file access, Operating Systems 1. Illust...

Operating Systems 1. Illustrate the Microkernel Architecture with suitable diagram. 2. When Deadlock occurs? What are the Necessary Conditions for Deadlock? 3. Describe f

What are the functions of virtual file system (vfs), What are the functions...

What are the functions of virtual file system (VFS)? a. It separates file-system-generic operations from their execution defining a clean VFS interface. It permits transparent

Explain how a domain user account is authenticated, Question: a) The fo...

Question: a) The following questions pertain to User and Group accounts in Windows XP: i) Give four differences between a Power User and a Guest User account. ii) Explain h

What is external fragmentation?, What is external fragmentation? As pro...

What is external fragmentation? As process are removed from and loaded to the memory free memory space is bracken into pieces .external fragmentation take place when enough mem

Relationship among a(x, Q. The RC 4000 system as well as other systems hav...

Q. The RC 4000 system as well as other systems have defined a tree of processes (called a process tree) such that all the descendants of a process are given resources (objects) as

What is busy waiting, What is busy waiting? The repeated implementation...

What is busy waiting? The repeated implementation of a loop of code while waiting for an event to happen is known as busy-waiting. The CPU is not engaged in any actual producti

Dynamic memory management, Usually memory is allocated from a large pool of...

Usually memory is allocated from a large pool of unused memory area called the heap. In C++, dynamic allocation/deallocation must be manually performed using commands like malloc,

Linux os, Introduction of linux

Introduction of linux

Explain peterson''s solution for the critical section problem, Explain the ...

Explain the Peterson's solution for the critical section problem? In Peterson's solution two variables a) flag and b) turn are used as shared variables. If the both shared vari

Write Your Message!

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