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
Q. Error detection in operating system? Error detection- Error detection take places at both the hardware and software levels. At the hardware level every data transfers must b

As we have discussed, page tables map virtual page addresses to physical page addresses. One of the advantages of using virtual addresses is that we can achieve complete separation

From hardware perspective, every information system can be divided into three task areas Presentation, Application Logic and Data Storage. The R/3 Basis software is extremely s

Write a Perl script assignGrades.pl to assign letter grades to the students.

what is cpu

Difference between cache and associate memory

Making the Transition to Client - Server Programming Making the transition to client - server programming is a significant effort. Client - server applications must be designed

how copy on write on pages when many process works at a same time?

Gopher Gallery consists of a shopping mall and a cart ride that covers the 150 acre habitat. There are m visitors and n single-person vehicles. Visitors stroll around the mall at t

is the operating system windows sometimes interupts