From 70013e198207caa0b45f2488cbf08349b0cecb2e Mon Sep 17 00:00:00 2001 From: Dan MacTough Date: Sat, 26 Dec 2015 15:37:16 -0500 Subject: [PATCH 1/3] Fix final dining philospher output to match actual program output. Also clarifies that only one philosopher may eat at a time, not two. --- src/doc/book/dining-philosophers.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/doc/book/dining-philosophers.md b/src/doc/book/dining-philosophers.md index a0f629c32e3fb..b3389dcf154f7 100644 --- a/src/doc/book/dining-philosophers.md +++ b/src/doc/book/dining-philosophers.md @@ -704,19 +704,19 @@ You’ll notice we can introduce a new binding to `table` here, and it will shadow the old one. This is often used so that you don’t need to come up with two unique names. -With this, our program works! Only two philosophers can eat at any one time, -and so you’ll get some output like this: +With this, our program works! Only one philosopher can eat at a time, and so +you’ll get some output like this: ```text -Gilles Deleuze is eating. Emma Goldman is eating. Emma Goldman is done eating. +Karl Marx is eating. +Karl Marx is done eating. +Gilles Deleuze is eating. Gilles Deleuze is done eating. Judith Butler is eating. -Karl Marx is eating. Judith Butler is done eating. Michel Foucault is eating. -Karl Marx is done eating. Michel Foucault is done eating. ``` From 8930b8933fd3248c17a75da258675d03ac641cc5 Mon Sep 17 00:00:00 2001 From: Dan MacTough Date: Sun, 27 Dec 2015 22:55:20 -0500 Subject: [PATCH 2/3] Revert "Fix final dining philospher output to match actual program output." This reverts commit 70013e198207caa0b45f2488cbf08349b0cecb2e. --- src/doc/book/dining-philosophers.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/doc/book/dining-philosophers.md b/src/doc/book/dining-philosophers.md index b3389dcf154f7..a0f629c32e3fb 100644 --- a/src/doc/book/dining-philosophers.md +++ b/src/doc/book/dining-philosophers.md @@ -704,19 +704,19 @@ You’ll notice we can introduce a new binding to `table` here, and it will shadow the old one. This is often used so that you don’t need to come up with two unique names. -With this, our program works! Only one philosopher can eat at a time, and so -you’ll get some output like this: +With this, our program works! Only two philosophers can eat at any one time, +and so you’ll get some output like this: ```text +Gilles Deleuze is eating. Emma Goldman is eating. Emma Goldman is done eating. -Karl Marx is eating. -Karl Marx is done eating. -Gilles Deleuze is eating. Gilles Deleuze is done eating. Judith Butler is eating. +Karl Marx is eating. Judith Butler is done eating. Michel Foucault is eating. +Karl Marx is done eating. Michel Foucault is done eating. ``` From 7dc753163b8129442f13503a566243bb9c3a5ca6 Mon Sep 17 00:00:00 2001 From: Dan MacTough Date: Sun, 27 Dec 2015 23:11:49 -0500 Subject: [PATCH 3/3] Clarify characterization of problem solution. Also add brief explanation about why program output may differ. --- src/doc/book/dining-philosophers.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/doc/book/dining-philosophers.md b/src/doc/book/dining-philosophers.md index a0f629c32e3fb..79b1b83af3e76 100644 --- a/src/doc/book/dining-philosophers.md +++ b/src/doc/book/dining-philosophers.md @@ -704,8 +704,10 @@ You’ll notice we can introduce a new binding to `table` here, and it will shadow the old one. This is often used so that you don’t need to come up with two unique names. -With this, our program works! Only two philosophers can eat at any one time, -and so you’ll get some output like this: +With this, our program works! No more than two philosophers can eat at any one +time, and so you’ll get some output like this (due to the arbitrary order of +execution of spawned threads, your output may be different -- and may be +different each time you run your program): ```text Gilles Deleuze is eating.