Question: 1 . Please carefully review the given solution and list three states. 2 . How should the Semaphore elements of EatAgain be initilized? Justify your

1. Please carefully review the given solution and list three states.
2. How should the Semaphore elements of EatAgain be initilized? Justify your answer.
3. How should the Semaphore mutex be initialized? Justify your answer.
4. What is the maximun number of Philosophers that can be waiting on a Semaphore element EatAgain[i] at any given time?
5.What is the maximum about of Philosophers that can be waiting on mutex at any given time?
6. Does the code work correctly if the statment EatAgain[i].P() is moved before mutex.V() in take_chopsticks()? Briefly explain it.
7. Does the code work correctly if the statements test((i+1)%5) and test((i+4)%5) are moved before state[i]=THINKING() in put_chopsticks()? Briefly explain it.
1 . Please carefully review the given solution

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!