A commented example of solving the dining philosophers multithreading problem.
Go to file
2023-04-19 01:28:50 +02:00
include Adding comments. 2023-04-19 01:28:50 +02:00
src Adding comments. 2023-04-19 01:28:50 +02:00
Doxyfile Adding first commit. 2023-04-19 00:32:59 +02:00
LICENSE Initial commit 2023-04-19 00:31:43 +02:00
meson.build Adding first commit. 2023-04-19 00:32:59 +02:00
README.md Adding comments. 2023-04-19 01:28:50 +02:00

dining-philosophers

A commented example of solving the dining philosophers multithreading problem.

Description of the dining philosophers problem.

The dinner philosophers problem consists of a round table where N number of philosophers are seated, every philosopher has a fork on each side that they are supposed to share with their neighbours to eat a spaghetti that can only eated by the usage of two forks.

The problem consists on achieving the table to be able to continuously eat without getting stuck in a deadlock without the chance of philosophers to talk between themselves.

Description of the solution.

For the solution I inspired on the Dijkstra's solution but using the OOP nature of C++ to make it more readable and near to the natural language.

The code is commented in its tricky parts in order to make the solution easier to understand.

https://en.wikipedia.org/wiki/Dining_philosophers_problem