Deadlock, Operating System

Suppose we have 3 processes running at the same time as shown in the following table. Each resource only has one instance.

Show a possible scenario of resource allocation that results in deadlock. Using a resource allocation graph to show the scenario.

To prevent the possibility of any deadlock, you may modify the order of getting resource requests of some process. Explain how and why. You can also use a resource allocation graph to  justify your answer.

P1

P2

P3

while (1) {

      get(A);

      get(B);

      get(C);

      // critical region

      // use A, B, C

      release(A);

      release(B);

      release(C);

}

while (1) {

     get(D);

      get(E);

      get(B);

      // critical region

      // use D, E, B

      release(D);

      release(E);

      release(B);

}

While (1) {

get(C);

get(F);

get(D);

// critical region

// use C, F, D

release(C);

release(F);

release(D);

}

 

Posted Date: 4/2/2013 4:02:38 AM | Location : United States







Related Discussions:- Deadlock, Assignment Help, Ask Question on Deadlock, Get Answer, Expert's Help, Deadlock Discussions

Write discussion on Deadlock
Your posts are moderated
Related Questions
Virtual File System serves two important functions. 1. It divides file-system-generic operations from their execution by defining a clean VFS interface. 2. The VFS is based

Example 1.  The diagram illustrating the data structures of in-memory VFS objects and on-disk objects and their relationships on slide 24 of the lecture notes OSD.4. This diagram i

What is the main advantage of multiprogramming? Multiprogramming makes efficient use of the CPU by overlapping the demands for the CPU and its I/O devices from various users. I

The term IPC (Inter-Process Communication) defines several paths by which different process executing on some operating system interact between each other.

Define deadlock prevention. Deadlock prevention is a set of process for ensuring that at least one of the four essential conditions like mutual exclusion, hold and wait, no pr

What are the different file operations? Create : - Space for the file in the file system update directory table. Write : - file name and data to be written is

Declare some Applications of Open Source Systems • Finance • Educational • Data Storage and Management • ERP (Enterprise Resource Planning) •File Sharing & FTP

Explain about demand paging? A demand paging system is same to a paging system with swapping. Processes reside on secondary memory. When we require executing a process, we chan

For the heat conduction problem, investigate the effects on the numerical solution of the following aspects: 1. non-uniform meshes with re?nement at both ends versus a uniform m

Concept of Reentrancy   It is a useful, memory-saving method for multiprogrammed timesharing machines. A Reentrant method is one in which multiple clients can share a singl