13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

130 Resource Deadlock Chapter 412534Figure 4.7 Deadlocked philosophers12534Figure 4.8 Philosopher 3 starvesphilosopher 2 finishes eating. Instead of granting 2’s right chopstick as 3’s left chopstick,which we have seen can lead to deadlock, let’s let the resource manager be more conservativeand leave that chopstick free. Later, philosopher 2 wants to eat again. Since philosopher1 is engrossed in thought and oblivious to the real world, the resource managergives philosopher 2 two chopsticks, leading again to the situation in Figure 4.8. Thenphilosopher 4 finishes eating. Again the resource manager decides not to grant philosopher4’s left chopstick to philosopher 3, because deadlock could result. Philosophers 2and 4 keep eating whenever they want, but poor philosopher 3, although no doubt quite

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!