Implementing the Philosophers
One solution:
Make eating the critical section, like so:
philosopher(int i) {
while(1) {
sem->P();
eat();
sem->V();
think();
}
What’s wrong here?
Previous slide
Next slide
Back to first slide
View graphic version