From 0cedb0fbdae3f1c7485a973e3015a3b5c2eb107b Mon Sep 17 00:00:00 2001 From: Diego Herrera Date: Thu, 30 Sep 2021 14:31:22 -0600 Subject: [PATCH 1/2] Updated description --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 295f625..579df09 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ -# Dining Philosophers Problem +# Dining Philosophers Problem [![license](https://img.shields.io/github/license/herrera-diego/dining-philosophers)](https://opensource.org/licenses/MIT) Implementation on Dining Philosophers problem on C++ +![Image](https://upload.wikimedia.org/wikipedia/commons/7/7b/An_illustration_of_the_dining_philosophers_problem.png) + +## Problem Statement + +A certain number of philosophers spend their lives alternating between thinking and eating. They are seated around a circular table. There is a fork placed between each pair of neighboring philosophers. Each philosopher has access to the forks at her left and right. In order to eat, a philosopher must be in possession of both forks. A philosopher may only pick up one fork at a time. Each philosopher attempts to pick up the left fork first and then the right fork. When done eating, a philosopher puts both forks back down on the table and begins thinking. Since the philosophers are sharing forks, it is not possible for all of them to be eating at the same time. + +This was originally formulated in 1965 by Edsger Dijkstra as a student exam exercise. -![Image](./docs/dining-philosophers.png) From f7d1ec0c7fe898668345298e0644e29416f226df Mon Sep 17 00:00:00 2001 From: Diego Herrera Date: Thu, 30 Sep 2021 14:46:51 -0600 Subject: [PATCH 2/2] Update index.md --- docs/index.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/index.md b/docs/index.md index 9050f2c..ea58050 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,7 +1,9 @@ -## Dinning Philosophers +# Dining Philosophers Problem -Imagine a round table with n seats. -Between each pair of seats is a chopstick. +![Image](https://upload.wikimedia.org/wikipedia/commons/7/7b/An_illustration_of_the_dining_philosophers_problem.png) -![Image](./dining-philosophers.png) +## Problem Statement +A certain number of philosophers spend their lives alternating between thinking and eating. They are seated around a circular table. There is a fork placed between each pair of neighboring philosophers. Each philosopher has access to the forks at her left and right. In order to eat, a philosopher must be in possession of both forks. A philosopher may only pick up one fork at a time. Each philosopher attempts to pick up the left fork first and then the right fork. When done eating, a philosopher puts both forks back down on the table and begins thinking. Since the philosophers are sharing forks, it is not possible for all of them to be eating at the same time. + +This was originally formulated in 1965 by Edsger Dijkstra as a student exam exercise.