









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










โ (^) Why would we ever reach a state where none of the philosophers make progress? โ (^) Consider the following scenario:
-bash-3.2$ ./dining_philosophers p0=2/10 p1=2/10 p2=2/11 p3=3/4 p4=1/ p0=0/10 p1=0/10 p2=0/11 p3=0/4 p4=0/ Reached deadlock
- P0 P โ (^) Implement the waiters solution in dining_philosophers.c โ (^) As a hint, I've initialized all the synchronization variables you should need. โ (^) There is a mutex named waiter which you should use to ensure mutual exclusion when โaskingโ the waiter and acquiring chopsticks. โ (^) There are also some new variables for each philosopher that can be used to implement the functionality of a waiter. These are accessible from within the philosopher code using the me pointer.
โ (^) To see this, imagine the following scenario: