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
As we already know, threadsmust ensure consistency; otherwise, race conditions (non-deterministic results) might happen. Now consider the "too much milk problem": two people share


Compare between the one and two-dimensional memory organizations in terms of the  memory structure,  advantages, and disadvantages.  Which approach would better support the needs o

Q. What system calls have to be implementing by a command interpreter or shell in order to start a new process? Answer: In the UNIX systems a fork system call followed by an ex

Is it probable to have a deadlock involving only one single process? Describe your answer. Answer: No This pursue directly from the hold-and-wait condition.

explain how indefinite blocking or starvation occurs..

Q. What are the major advantages of the microkernel approach to system design? Answer: Benefits usually include the following (a) Adding a new service doesn't require modify

Define Segmentation  The memory allocation method subject to “external” fragmentation is Segmentation.

Process States A total of nine states are acknowledged by the UNIX system. They are like as follow: User running                                                   Executing

Determine a processing that is not a part of Synthesis phase  Perform LC processing is not a part of Synthesis phase