Question: The Dining Philosophers Problem In this problem, five philosophers sit around a circular table eating spaghetti and thinking. In front of each philosopher is a

The Dining Philosophers Problem

In this problem, five philosophers sit around a circular table eating spaghetti and thinking. In front of each philosopher is a plate and to the left of each plate is a fork (so there are five forks, one to the right and one to the left of each philosopher's plate; see the figure). When a philosopher wishes to eat, he picks up the forks to the right and to the left of his plate. When done, he puts both forks back on the table. The problem is to ensure that no philosopher will be allowed to starve because he cannot ever pick up both forks.

There are two issues here: first, deadlock (where each philosopher picks up one fork so none can get the second) must never occur; and second, no set of philosophers should be able to act to prevent another philosopher from ever eating. A solution must prevent both.

Development Requirements

1.Constraints. Coding must use C++ / CLI and generate executable programs.

2.Name constraints

for GUI applications:

Create a Visual Studio Solution folder with a descriptive name for the assignment problem and Visual Studio version used (2008 or 2013), e.g. Problem1_VS2008_Solution

The start project name must be CppGUI_Project

The start form name must be Form1. Any additional forms must be named Form2, Form3, etc.

for console applications

Name the source file containing the entry point with the problem name, e.g. Problem3.cpp. If your solution is implemented with several source files, place all source files in a folder named with the problem name, e.g. folder Problem3.

Dependencies. You are encouraged to use global constants, but your program must limit the use of global variables to only the ones that are absolutely necessary for communication between forms

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 Databases Questions!