Question: In C language, give a solution to dining philosophers problem using busy waiting loop (without semaphores). Prompt user for number of philosophers, then number of
In C language, give a solution to dining philosophers problem using busy waiting loop (without semaphores). Prompt user for number of philosophers, then number of meals. Then follow the algorithm:
- Sit down at table.
- Pick up left chopstick.
- Pick up right chopstick.
- Begin eating.
- Continue eating for 2-7 cycles.
- Put down left chopstick.
- Put down right chopstick.
- Begin thinking.
- Continue thinking for 2-7 cycles.
- IF all meals have not been eaten, GOTO 2.
- ELSE leave the table.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
