Question
There is a classic problem of synchronization and concurrency called the dining philosophers problem. The general idea is that there is a set of philosophers
There is a classic problem of synchronization and concurrency called the dining philosophers problem. The general idea is that there is a set of philosophers that are sitting around a round table. These philosophers can do one of two things; eating or thinking. When they are eating, they cannot think. When they are thinking, they cannot eat. A bowl of pasting is placed in the center of the round table. A fork is placed between each philosopher. The result is that there is a single fork to the left and a single fork to the right of each philosopher. Due to the way that they eat pasta, each philosopher needs two forks to eat and can only use the fork to their immediate left and right. The philosophers do not speak to one another.
In a Word document, answering the following questions: Describe the situation in which none of the philosophers never eat (also called starvation). What would be the steps that occur that would lead up to this situation?
Describe how we can solve this issue by introducing the concept of priority. Explain how we can guarantee that all philosophers would be treated equally?
Consider the ability to now can hire a waiter to oversee assigning the forks to the philosophers. No one can pick up a fork until the waiter says that they can. The waiter has global knowledge of all the forks. In addition, consider the policy that the philosophers will always request to pick up their left fork first before picking up their right fork. How does that guarantee to avoid starvation?
Consider the same waiter but getting the requests in a queue format. With a queue, the requests are handled in the order that they are received. Describe a scenario in which the service may not be granted.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started