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
Explain a working of file control block A file control block (FCB) has information about the file, containing ownership, permission, and location of the file contents. The log

We can view an operating system as a resource allocator. Explain. We can outlook an operating system as a resource allocator. A computer system has Many resources (software and

What are the various layers of a file system? The file system is composed of many dissimilar levels. Each level in the design uses the feature of the lower levels to make new f

Q. Polling for an I/O completion is able to waste a large number of CPU cycles if the processor iterates a busy-waiting loop several times before the I/O completes. However if the

Question 1 Describe about the shells of Linux operating system Question 2 Describe briefly about GNOME desktop Question 3 Write note on the following- Encryp

Developing Code with Threads Writing code to support a thread-based implementation is very straightforward. Simple APIs are presented to the developer for each threads package.

What is turnaround time? Turnaround time is the interval from the time of submission to the time of completion of a process. It is the sum of the periods exhausted waiting to g

Write a short note about process. Unceremoniously, a process is a program in implementation. A process is too much than the program code, which is occasionally known as the tex

Define Virtual memory Virtual memory is employed in all major commercial operating systems

Linked allocation With linked allocation, every file is a linked list of disk blocks; the disk blocks might be scattered anywhere on the disk. The directory has a pointer to th