Talk:Dining philosophers problem

message: "After the philosopher is done eating, he again obtains a mutex lock, changes his state to thinking and sees, one at a time, if either of his two neighbors are hungry. If at least one is hungry, that philosopher enters the eating state if his other neighbor is not eating, and the cycle continues."
When the philosopher is done eating, and one of his neighbors is hungry, he eats again?
:I don't understand either--Chealer 02:58, 2005 Mar 27 (UTC)
:No, the neighbor starts eating if his forks are available. It seems to be a Hoare-style condition variable approach. Gazpacho 03:23, 27 Mar 2005 (UTC)
thread_title:  This makes no sense 

message: "In most cases, the dining philosophers problem is explained using rice and chopsticks as opposed to spaghetti and forks, as it is obviously easier to understand that two chopsticks are required, whereas one could arguably eat spaghetti using a single fork, or using a fork and a spoon." 
This statement is inaccurate as explanation would be dining philosophers eating rice with chopsticks and not forks. I would advise to delete this or better offer it as an alternate description. Pixeleditor (talk) 17:50, 17 April 2008 (UTC)
replies: text: Yes, Chopsticks and rice makes more sense, and if my opinion were worth more than two cents, I would encourage every CS professor to teach it that way, But historically, spaghetti and forks actually is the traditional version. 74.111.96.172 (talk) 20:57, 7 March 2022 (UTC)

text: It's been rewritten - is it clear now? Rp (talk) 10:44, 27 January 2012 (UTC)
thread_title:  Inaccurate statement 

message: Just guessing that the number of philosophers is relatively irelevant to the basics, so.
#Do the prim factors of the phylosopher-count matter at all?
#Could there always be as much parallel circles as prim factors of the phylosopher-count no matter what algorythm is used?
#Could parallel circles mix depending on the used algorythm?
#Could parallel circles merge, or split if you add or substract a phylosopher, its table and fork (depending on the used algorythm)? — Preceding unsigned comment added by Ollj (talk • contribs) 19:55, 6 April 2006 (UTC)
replies: text: If your question still applies to the present state of the article, please rephrase. Rp (talk) 10:46, 27 January 2012 (UTC)
thread_title: prim factors

message: The problem is due to Dijkstra, the parable is due to Tony Hoare. Dijkstra's original was about tape drives. --Gorgonzilla 19:19, 10 April 2006 (UTC)
replies: text: I believe this has been fixed now. Rp (talk) 21:25, 29 July 2011 (UTC)
thread_title: Misattribution

message: The problem statement states that the philosophers never speak to each other. However, Chandy / Misra Solution uses requests and signals. Is it a valid solution? —The preceding unsigned comment was added by VinnieCool (talk • contribs) 19:40, 28 December 2006 (UTC)
thread_title:  Communication or not! 

message: If we name philosophers from P1 to P5 and forks from F1 to F5, and we make odd-numbered philosophers take the fork on their right first, and even-numbered ones take the forks on their left first, you can have two simultaneous philosophers eating at the same time on a worst case scenario (all philosophers become hungry at the same time). Does not solve starvation, though, when two processes are quick thinkers and eaters. -- Alx5000 02:26, 13 June 2007 (UTC)
thread_title:  Even/Odd differentiation 

message: I have re-written the page to use rice and chopsticks instead of forks and spaghetti. The problem states that it is easier to understand, so why not write it that way in the first place? Additionally, the word 'fork' is used elsewhere in concurrent programming which may lead to confusion. I decided to remove the 'alternate way of explaining the problem' altogether to lead to less confusion.  —Preceding unsigned comment added by 74.202.89.125 (talk) 15:37, 6 December 2007 (UTC)
replies: text: Wikipedia must document the problem statement as it is best known, because people may want to look that up; hence, the rice and chopsticks have been relegated to a side remark. Rp (talk) 10:50, 27 January 2012 (UTC)
thread_title:  Forks vs chopsticks 

message: This is in regards to the "solution" where a philosopher will, in response to waiting 5 minutes for a second chopstick:
* release the chopstick,
* wait a random interval of time, and
* attempt to acquire both chopsticks again.
I'm not sure that this is actually a solution.  Waiting a random interval of time before another attempt to grab a chopstick is likely to prevent livelock, but there is no guarantee, at least not that I can see.  Theoretically, the random number generator could produce the same number indefinitely.  Can we either get a proof that "Chaos" is a solution to this problem or remove the "Chaos" section?  It may even be beneficial to move this into a "non-solutions" section and explain why it isn't a solution.
Here's an example that may help.  Let's say one were to decide which philosopher gets a chopstick by a contest using coin tosses.  Each philosopher gets a coin, and both of them flip.  If they both get heads or they both get tails, they flip again.  If only one gets heads, that philosopher get the chopstick.  Nothing forces the pair of philosophers to eventually get one heads and one tails.  167.136.242.30 (talk) 16:04, 25 February 2008 (UTC)
replies: text: It's a randomized algorithm. Randomized algorithms are designed to reach a valid configuration with high probability in reasonable time, rather than to produce any result with certainty. I don't have sources on this particular algorithm though. Dcoetzee 22:42, 25 February 2008 (UTC)
thread_title:  Solutions --> Chaos 

message: I had this idea during the reading the article. I'm sure that somebody had this idea before. What if first phylospoher wait 2 minute and if he detect lock put the fork down for 2 minute, second waid/put down for 3 minutes, third for 5, forth for 7 and the fifth for 11? Uzytkownik (talk) 21:22, 9 May 2008 (UTC)
replies: text: Yes, using timing can work, and I don't know if it is somehow explicitly precluded in the original problem statement. However in realistic cases of this type of problem it may not always be possible to use timing with sufficient precision. Rp (talk) 10:53, 27 January 2012 (UTC)
thread_title:  Differentiate waiting time 

message: *Unlike in Dijkstra's solution, these labelings can be arbitrary.
**What is Dijkstra's solution? The article currently doesn't state it. --Abdull (talk) 09:04, 8 August 2008 (UTC)
thread_title:  Dijkstra's solution? 

message: The text says there is a single plate of spaghetti in the centre of the table but the illustration shows multiple plates.  This is significant because the text explains that the serving and eating is the reason that two forks are required.
:The inconsistency is still there, 2013.11.05. Kdammers (talk) 08:01, 5 November 2013 (UTC)
replies: text: There are no limitations on the spaghetti, so it doesn't really matter whether it is in one heap or in several; but the text and illustration should be consistent. I think it's best to change the picture - I'll ask the author. Rp (talk) 10:17, 5 November 2013 (UTC)
thread_title:  Diagram / Text inconsistency 

message: THIS IS  CONFUSING  —Preceding unsigned comment added by 117.241.218.126 (talk) 08:05, 7 May 2010 (UTC)
thread_title:  DEADLOCK 

message: Won't compile on FreePascal:
 philos.pas(5,12) Fatal: Syntax error, "=" expected but "identifier DINING_PHILOSOPHERS" found
 philos.pas(0) Fatal: Compilation aborted
--HTMLCODER.exe (talk) 11:24, 25 August 2010 (UTC)
thread_title:  Pascal implementation 

message: How is it possible to have all 5 eating at the same time???
Here is the result I got when I ran the program: (marked bold)
1285281094258 0 00000 Philosopher 0 is thinking </br>
1285281094258 0 00000 Philosopher 4 is thinking </br>
1285281094258 0 00000 Philosopher 3 is thinking </br>
1285281094258 0 00000 Philosopher 2 is thinking </br>
1285281094258 0 00000 Philosopher 1 is thinking </br>
1285281094519 5 00000 Philosopher 4 is hungry and is trying to pick up his chopsticks </br>
1285281094531 6 00000 Philosopher 1 is hungry and is trying to pick up his chopsticks </br>
1285281094615 7 00000 Philosopher 3 is hungry and is trying to pick up his chopsticks </br>
1285281094798 8 00000 Philosopher 0 is hungry and is trying to pick up his chopsticks </br>
1285281095214 9 00010 Philosopher 3 is eating </br>
1285281095246 10 01010 Philosopher 1 is eating </br>
1285281095296 11 01010 Philosopher 2 is hungry and is trying to pick up his chopsticks </br>
1285281095302 12 01011 Philosopher 4 is eating </br>
1285281095729 13 01111 Philosopher 2 is eating </br>
1285281095751 14 11111 Philosopher 0 is eating </br>
1285281095770 15 10111 Philosopher 1 finished eating, and puts away his chopsticks </br>
1285281095770 16 10111 Philosopher 1 is thinking </br>
1285281095862 17 00111 Philosopher 0 finished eating, and puts away his chopsticks </br>
1285281095862 18 00111 Philosopher 0 is thinking </br>
1285281095912 19 00101 Philosopher 3 finished eating, and puts away his chopsticks </br>
1285281095912 20 00101 Philosopher 3 is thinking </br>
1285281095914 21 00101 Philosopher 1 is hungry and is trying to pick up his chopsticks </br>
1285281095961 22 00101 Philosopher 0 is hungry and is trying to pick up his chopsticks </br>
1285281096096 23 00100 Philosopher 4 finished eating, and puts away his chopsticks </br>
1285281096096 24 00100 Philosopher 4 is thinking </br>
1285281096175 25 00100 Philosopher 3 is hungry and is trying to pick up his chopsticks </br>
1285281096232 26 10100 Philosopher 0 is eating </br>
1285281096434 27 10000 Philosopher 2 finished eating, and puts away his chopsticks </br>
1285281096434 28 10000 Philosopher 2 is thinking </br>
1285281096527 29 10010 Philosopher 3 is eating </br>
1285281096594 30 11010 Philosopher 1 is eating </br>
1285281096677 31 11010 Philosopher 4 is hungry and is trying to pick up his chopsticks </br>
1285281096938 32 11011 Philosopher 4 is eating </br>
1285281096952 33 11011 Philosopher 2 is hungry and is trying to pick up his chopsticks </br>
1285281097079 34 01011 Philosopher 0 finished eating, and puts away his chopsticks </br>
1285281097079 35 01011 Philosopher 0 is thinking </br>
1285281097350 36 01001 Philosopher 3 finished eating, and puts away his chopsticks </br>
1285281097350 37 01001 Philosopher 3 is thinking </br>
1285281097351 38 00001 Philosopher 1 finished eating, and puts away his chopsticks </br>
1285281097351 39 00001 Philosopher 1 is thinking </br>
1285281097443 40 00001 Philosopher 1 is hungry and is trying to pick up his chopsticks </br>
1285281097479 41 00101 Philosopher 2 is eating </br>
1285281097520 42 00100 Philosopher 4 finished eating, and puts away his chopsticks </br>
1285281097520 43 00100 Philosopher 4 is thinking </br>
1285281097680 44 00100 Philosopher 0 is hungry and is trying to pick up his chopsticks </br>
1285281097723 45 00000 Philosopher 2 finished eating, and puts away his chopsticks </br>
1285281097723 46 00000 Philosopher 2 is thinking </br>
1285281097725 47 00000 Philosopher 4 is hungry and is trying to pick up his chopsticks </br>
1285281097792 48 10000 Philosopher 0 is eating </br>
1285281098025 49 10000 Philosopher 3 is hungry and is trying to pick up his chopsticks </br>
1285281098134 50 10001 Philosopher 4 is eating </br>
1285281098299 51 10011 Philosopher 3 is eating </br>
1285281098302 52 00011 Philosopher 0 finished eating, and puts away his chopsticks </br>
1285281098302 53 00011 Philosopher 0 is thinking </br>
1285281098321 54 00011 Philosopher 2 is hungry and is trying to pick up his chopsticks </br>
1285281098352 55 00001 Philosopher 3 finished eating, and puts away his chopsticks </br>
1285281098352 56 00001 Philosopher 3 is thinking </br>
1285281098367 57 01001 Philosopher 1 is eating </br>
1285281098478 58 00001 Philosopher 1 finished eating, and puts away his chopsticks </br>
1285281098478 59 00001 Philosopher 1 is thinking </br>
1285281098499 60 00001 Philosopher 0 is hungry and is trying to pick up his chopsticks </br>
1285281098553 61 00101 Philosopher 2 is eating </br>
1285281098859 62 00100 Philosopher 4 finished eating, and puts away his chopsticks </br>
1285281098859 63 00100 Philosopher 4 is thinking </br>
1285281098863 64 00100 Philosopher 3 is hungry and is trying to pick up his chopsticks </br>
1285281099283 65 00100 Philosopher 1 is hungry and is trying to pick up his chopsticks </br>
1285281099352 66 10100 Philosopher 0 is eating </br>
1285281099378 67 10110 Philosopher 3 is eating </br>
1285281099396 68 11110 Philosopher 1 is eating </br>
1285281099439 69 11010 Philosopher 2 finished eating, and puts away his chopsticks </br>
1285281099439 70 11010 Philosopher 2 is thinking </br>
1285281099688 71 11010 Philosopher 2 is hungry and is trying to pick up his chopsticks </br>
1285281099833 72 11010 Philosopher 4 is hungry and is trying to pick up his chopsticks </br>
1285281099845 73 01010 Philosopher 0 finished eating, and puts away his chopsticks </br>
1285281099845 74 01010 Philosopher 0 is thinking </br>
1285281100038 75 01011 Philosopher 4 is eating </br>
1285281100068 76 00011 Philosopher 1 finished eating, and puts away his chopsticks </br>
1285281100068 77 00011 Philosopher 1 is thinking </br>
1285281100074 78 00111 Philosopher 2 is eating </br>
1285281100262 79 00101 Philosopher 3 finished eating, and puts away his chopsticks </br>
1285281100262 80 00101 Philosopher 3 is thinking </br>
1285281100411 81 00101 Philosopher 0 is hungry and is trying to pick up his chopsticks </br>
1285281100425 82 00100 Philosopher 4 finished eating, and puts away his chopsticks </br>
1285281100425 83 00100 Philosopher 4 is thinking </br>
1285281100427 84 00100 Philosopher 1 is hungry and is trying to pick up his chopsticks </br>
1285281100437 85 01100 Philosopher 1 is eating </br>
1285281100790 86 00100 Philosopher 1 finished eating, and puts away his chopsticks </br>
1285281100790 87 00100 Philosopher 1 is thinking </br>
1285281100949 88 00000 Philosopher 2 finished eating, and puts away his chopsticks </br>
1285281100949 89 00000 Philosopher 2 is thinking </br>
1285281101013 90 00000 Philosopher 1 is hungry and is trying to pick up his chopsticks </br>
1285281101198 91 00000 Philosopher 3 is hungry and is trying to pick up his chopsticks </br>
1285281101235 92 00000 Philosopher 2 is hungry and is trying to pick up his chopsticks </br>
1285281101236 93 00000 Philosopher 4 is hungry and is trying to pick up his chopsticks </br>
1285281101252 94 10000 Philosopher 0 is eating </br>
1285281101333 95 10100 Philosopher 2 is eating </br>
1285281101341 96 10101 Philosopher 4 is eating </br>
1285281101384 97 11101 Philosopher 1 is eating </br>
1285281101669 98 11001 Philosopher 2 finished eating, and puts away his chopsticks </br>
1285281101669 99 11001 Philosopher 2 is thinking </br>
1285281102083 100 01001 Philosopher 0 finished eating, and puts away his chopsticks </br>
1285281102083 101 01001 Philosopher 0 is thinking </br>
1285281102133 102 01011 Philosopher 3 is eating </br>
1285281102167 103 01011 Philosopher 2 is hungry and is trying to pick up his chopsticks </br>
1285281102227 104 00011 Philosopher 1 finished eating, and puts away his chopsticks </br>
1285281102227 105 00011 Philosopher 1 is thinking </br>
1285281102245 106 00011 Philosopher 0 is hungry and is trying to pick up his chopsticks </br>
1285281102292 107 00010 Philosopher 4 finished eating, and puts away his chopsticks </br>
1285281102292 108 00010 Philosopher 4 is thinking </br>
1285281102326 109 10010 Philosopher 0 is eating </br>
1285281102676 110 10010 Philosopher 1 is hungry and is trying to pick up his chopsticks </br>
1285281102883 111 00010 Philosopher 0 finished eating, and puts away his chopsticks </br>
1285281102883 112 00010 Philosopher 0 is thinking </br>
1285281103040 113 00110 Philosopher 2 is eating </br>
1285281103045 114 00110 Philosopher 4 is hungry and is trying to pick up his chopsticks </br>
1285281103069 115 01110 Philosopher 1 is eating </br>
1285281103075 116 01100 Philosopher 3 finished eating, and puts away his chopsticks </br>
1285281103075 117 01100 Philosopher 3 is thinking </br>
1285281103196 118 01100 Philosopher 0 is hungry and is trying to pick up his chopsticks </br>
1285281103356 119 01101 Philosopher 4 is eating </br>
1285281103388 120 01001 Philosopher 2 finished eating, and puts away his chopsticks </br>
1285281103388 121 01001 Philosopher 2 is thinking </br>
1285281103408 122 01001 Philosopher 2 is hungry and is trying to pick up his chopsticks </br>
1285281103415 123 11001 Philosopher 0 is eating </br>
1285281103475 124 10001 Philosopher 1 finished eating, and puts away his chopsticks </br>
1285281103475 125 10001 Philosopher 1 is thinking </br>
1285281103535 126 10001 Philosopher 3 is hungry and is trying to pick up his chopsticks </br>
1285281103645 127 10101 Philosopher 2 is eating </br>
1285281103665 128 00101 Philosopher 0 finished eating, and puts away his chopsticks </br>
1285281103665 129 00101 Philosopher 0 is thinking </br>
1285281103717 130 00100 Philosopher 4 finished eating, and puts away his chopsticks </br>
1285281103717 131 00100 Philosopher 4 is thinking </br>
1285281103916 132 00100 Philosopher 4 is hungry and is trying to pick up his chopsticks </br>
1285281104093 133 00110 Philosopher 3 is eating </br>
1285281104182 134 00110 Philosopher 1 is hungry and is trying to pick up his chopsticks </br>
1285281104256 135 00010 Philosopher 2 finished eating, and puts away his chopsticks </br>
1285281104256 136 00010 Philosopher 2 is thinking </br>
1285281104299 137 01010 Philosopher 1 is eating </br>
1285281104302 138 01000 Philosopher 3 finished eating, and puts away his chopsticks </br>
1285281104302 139 01000 Philosopher 3 is thinking </br>
1285281104342 140 01000 Philosopher 0 is hungry and is trying to pick up his chopsticks </br>
1285281104344 141 01000 Philosopher 2 is hungry and is trying to pick up his chopsticks </br>
1285281104410 142 11000 Philosopher 0 is eating </br>
1285281104614 143 10000 Philosopher 1 finished eating, and puts away his chopsticks </br>
1285281104614 144 10000 Philosopher 1 is thinking </br>
1285281104664 145 10000 Philosopher 3 is hungry and is trying to pick up his chopsticks </br>
1285281104716 146 10100 Philosopher 2 is eating </br>
1285281104773 147 10110 Philosopher 3 is eating </br>
1285281104901 148 10111 Philosopher 4 is eating </br>
1285281104944 149 10101 Philosopher 3 finished eating, and puts away his chopsticks </br>
1285281104944 150 10101 Philosopher 3 is thinking </br>
1285281105023 151 00101 Philosopher 0 finished eating, and puts away his chopsticks </br>
1285281105023 152 00101 Philosopher 0 is thinking </br>
1285281105028 153 00001 Philosopher 2 finished eating, and puts away his chopsticks </br>
1285281105028 154 00001 Philosopher 2 is thinking </br>
1285281105160 155 00001 Philosopher 2 is hungry and is trying to pick up his chopsticks </br>
1285281105249 156 00001 Philosopher 0 is hungry and is trying to pick up his chopsticks </br>
1285281105520 157 00001 Philosopher 1 is hungry and is trying to pick up his chopsticks </br>
1285281105545 158 01001 Philosopher 1 is eating </br>
1285281105564 159 01000 Philosopher 4 finished eating, and puts away his chopsticks </br>
1285281105564 160 01000 Philosopher 4 is thinking </br>
1285281105571 161 01000 Philosopher 3 is hungry and is trying to pick up his chopsticks </br>
1285281105782 162 01100 Philosopher 2 is eating </br>
1285281105795 163 00100 Philosopher 1 finished eating, and puts away his chopsticks </br>
1285281105795 164 00100 Philosopher 1 is thinking </br>
1285281105983 165 00100 Philosopher 4 is hungry and is trying to pick up his chopsticks </br>
1285281106013 166 10100 Philosopher 0 is eating </br>
1285281106015 167 10101 Philosopher 4 is eating </br>
1285281106268 168 10111 Philosopher 3 is eating </br>
1285281106334 169 10011 Philosopher 2 finished eating, and puts away his chopsticks </br>
1285281106334 170 10011 Philosopher 2 is thinking </br>
1285281106507 171 10011 Philosopher 1 is hungry and is trying to pick up his chopsticks </br>
1285281106778 172 00011 Philosopher 0 finished eating, and puts away his chopsticks </br>
1285281106778 173 00011 Philosopher 0 is thinking </br>
1285281106818 174 00011 Philosopher 0 is hungry and is trying to pick up his chopsticks </br>
1285281106993 175 00010 Philosopher 4 finished eating, and puts away his chopsticks </br>
1285281106993 176 00010 Philosopher 4 is thinking </br>
1285281107059 177 00010 Philosopher 4 is hungry and is trying to pick up his chopsticks </br>
1285281107167 178 00000 Philosopher 3 finished eating, and puts away his chopsticks </br>
1285281107167 179 00000 Philosopher 3 is thinking </br>
1285281107220 180 00000 Philosopher 2 is hungry and is trying to pick up his chopsticks </br>
1285281107329 181 00001 Philosopher 4 is eating </br>
1285281107352 182 10001 Philosopher 0 is eating </br>
1285281107386 183 11001 Philosopher 1 is eating </br>
1285281107410 184 11101 Philosopher 2 is eating </br>
1285281107552 185 11001 Philosopher 2 finished eating, and puts away his chopsticks </br>
1285281107663 186 11000 Philosopher 4 finished eating, and puts away his chopsticks </br>
1285281107663 187 11000 Philosopher 4 is thinking </br>
1285281107885 188 11000 Philosopher 3 is hungry and is trying to pick up his chopsticks </br>
1285281107965 189 10000 Philosopher 1 finished eating, and puts away his chopsticks </br>
1285281107993 190 00000 Philosopher 0 finished eating, and puts away his chopsticks </br>
1285281108077 191 00010 Philosopher 3 is eating </br>
1285281108159 192 00010 Philosopher 4 is hungry and is trying to pick up his chopsticks </br>
1285281108268 193 00000 Philosopher 3 finished eating, and puts away his chopsticks </br>
1285281108268 194 00000 Philosopher 3 is thinking </br>
1285281108815 195 00001 Philosopher 4 is eating </br>
1285281109261 196 00001 Philosopher 3 is hungry and is trying to pick up his chopsticks </br>
1285281109650 197 00000 Philosopher 4 finished eating, and puts away his chopsticks </br>
1285281109668 198 00010 Philosopher 3 is eating </br>
1285281110285 199 00000 Philosopher 3 finished eating, and puts away his chopsticks </br>
— Preceding unsigned comment added by 134.117.251.6 (talk) 22:54, 23 September 2010 (UTC)
replies: text: Looks like that code has a bug.  I'm not sure which of the two Java implementations it was, but I removed all the code examples since they were cluttering up the article.  75.57.242.120 (talk) 19:39, 20 March 2011 (UTC)
thread_title:  Java Implementation 

message: I believe the Java Implementation is not a true solution to the problem at hand, as it has a semaphore allowing for 5 of them to be eating at once... this doesn't take into account the 'resources' which are the 5 forks that each philosopher needs two of to go ahead and eat. 24.116.42.202 (talk) 03:57, 21 October 2010 (UTC)
thread_title: Java implementation (II)

message: Good article guys. I thought I'd contribute some solutions based on Erlang:
https://github.com/TTimo/Dining-Philosophers---Erlang/blob/master/conductor.erl  — Preceding unsigned comment added by TTimo (talk • contribs) 17:31, 30 December 2010 (UTC)
thread_title:  Erlang implementation 

message: "The logic is kept simple by specifying that philosophers always seek to pick up their left hand fork before their right hand fork (or vice versa)."
This is quite unclear why that is. Is it to ensure that e.g. philosopher D will not take the fork left of E if A is the first to stop eating ? As far as I know this is already a requirement of the problem , that a philosopher cannot take any forks than the ones next to him.  — Preceding unsigned comment added by MadsBogeskov (talk • contribs) 11:32, 13 February 2011 (UTC)
thread_title:  Conductor Solution 

message: There's an awful lot of space taken up by code, and at least one of the implementations seems to be wrong (see the post above with a log showing all 5 philosophers eating simultaneously).  How about if we get rid of them and link here.  There also seems to be a fair amount of extlink cruft and maybe some cleanup is appropriate.  75.57.242.120 (talk) 06:27, 16 March 2011 (UTC)
replies: text: I made this change after a big battle against the edit filter.  I think Rosetta Code is ok to use like this, as it's a GFDL wiki with no advertising.  It doesn't seem perfect though; having some kind of code sample seems reasonable.  Feel free to discuss. 75.57.242.120 (talk) 12:19, 16 March 2011 (UTC)
replies: text:  Good move! —Ruud 15:49, 17 March 2011 (UTC)

text:  FYI, RC is not guaranteed to remain advert-free (heck, it's not even a non-profit), so be careful of using that as a predicate for outsourcing code hosting examples. Otherwise, feel free to use RC as a code-based demonstration ground for any WP articles that need it. I've intentionally set RC up as a place where language advocates can compete, and that should reduce the pressure on WP from "hey, you need to show examples using this langauge or paradigm!"  (Full disclosure: I own RC) --Michael Mol (talk) 02:31, 30 June 2011 (UTC)

text: restored all the material with "undo".  I don't think that's good, but am open to intermediate solutions.  I'll leave the reverter a usertalk message asking him/her to discuss the edit here. 75.57.242.120 (talk) 11:26, 22 March 2011 (UTC)

text: Having gotten no response to the talk message I'm going to unrevert. 75.57.242.120 (talk) 22:17, 23 March 2011 (UTC)
thread_title:  implementations 

message: Is it me, or is the Conductor solution not quite right?  If 4 of the philosophers request their left fork, they would get it.  According to the wiki page, "When four of the forks are in use, the next philosopher to request one has to wait for the waiter's permission, which is not given until a fork has been released."   That's not accurate, because in the scenario i just described, no one would ever release a fork.  I think that that SHOULD say:
"When four of the forks are in use, the next philosopher to request one will receive it if it is their right fork (ie it would allow them to eat).  If not, they will be forced to wait until a fork has been released."  — Preceding unsigned comment added by 71.201.26.202 (talk) 18:05, 14 December 2011 (UTC)
replies: text: I think you're right. I implemented this using a straightforward semaphore in Java, and all of the philosophers starve. The waiter requires knowledge of how many forks each philosopher is holding.  — Preceding unsigned comment added by 86.177.125.249 (talk) 12:36, 27 March 2012 (UTC)
thread_title:  Conductor Solution error 

message: I suggest to place the 'Resource hierarchy solution' first: 1) It is the solution originally proposed by Dijkstra. 2) As opposed to the solution currently placed first, it requires no external component. Lklundin (talk) 12:38, 13 February 2013 (UTC)
thread_title:  Order of Solutions 

message: The Dining philosophers problem has a solution but by a unique way that is..
First should be a condition that at a time a phiolospher have both fork from his left & right 
side by his neibhours and after a limit time he should put on the down for a limited few second and by this the other philosopher have a chance to put both forks if there are released from the both side at a time in this have vo caondition to clean the fork..and by this this should be continue......  — Preceding unsigned comment added by 119.226.42.242 (talk) 07:11, 7 August 2013 (UTC)
thread_title:  BY Kaushal :-Dining philosophers problem Solution 

message: Is a bad idea. Let them starve.137.205.183.82 (talk) 13:33, 13 April 2015 (UTC)
thread_title:  Feeding Philosophers 

message: An arbitrator can handle the fork allocation by using a bit mask. Each fork is represented as a bit. When a philosopher attempts to acquire the forks, he asks the arbitrator to assign the 2 forks to him. The arbitrator can synchronously test both bits and refuse the request when either are already set. If the bits are zero, the arbitrator synchronously marks both bits and notifies the philosopher to start eating. The philosopher notifies the arbitrator that he is finished and the arbitrator synchronously turns off the bits.
This design can be implemented through a compare-and-swap machine instruction to fetch or store the bit mask. A simple loop for an unequal compare refreshes the local copy of the bit mask and a retry. This is guaranteed not to starve, suspend, or spin indefinitely, because each philosopher is not "holding" a lock, but merely synchronously inspecting bits and changing the bits with a concurrent update mechanism. A software spinlock (with proper memory barriers) can be used instead of a hardware compare-and-swap for the very short critical section that fetches, compares, and updates the bit mask.71.237.53.70 (talk) 03:47, 20 May 2015 (UTC)
replies: text: That is interesting from a computer science perspective although I have to wonder what 'efficient' means in the combined context of 'bit mask' and 'java'. But I digress. Wikipedia has the limitation that we cannot accept so called original research, i.e. research (or other information) that has not been published via a so called reliable source. Is there such a reliable source that describes the software in question? Lklundin (talk) 22:23, 21 May 2015 (UTC)
replies: text: That's why this is in the Talk section, rather than the Article section. The software mutex is a java implementation of the Peterson (1981) algorithm published in "Algorithms for Mutual Exclusion", M. Raynal, ..71.237.53.70 (talk) 22:35, 21 May 2015 (UTC)
replies: text: I feel this confuses concept with implementation. This problem is conceptual; terms such as software shouldn't occur in descriptions of its solution. Besides, the given solution doesn't actually solve the problem: the magic spinlock mutex somehow needs guaranteed mutually exclusive access to those bits,
 while the point of the dining philosopher's problem is finding a solution that can work without such a guarantee. Rp (talk) 14:48, 18 March 2018 (UTC)
replies: text: There are bigger problems. It might even be true that the arbitrator solution is the "simplest"; it uses simple logic, without restrictions like "each philosopher must obtain his forks in numerically ascending order" that are quite uncommon in most other software. But "simplest" is not the only useful metric to judge an algorithm by. The arbitrator solution doesn't scale. If you had 1000 philosophers, you would still have only one arbitrator, which would be a big source of resource contention. Whereas in solutions with a lock for each fork, up to half of the philosophers can obtains their forks and eat simultaneously. --Bigpeteb (talk) 15:54, 19 March 2018 (UTC)
thread_title:  Arbitrator solution is simplest 

message: Is it really necessary to use "they" to refer to individual philosophers?  When reading the text, I was at first confused and then irritated. 37.99.61.154 (talk) 22:45, 26 January 2019 (UTC)
thread_title:  They 

message: As currently written, the problem statement refers to chopsticks, and subsequent discussion discusses forks. I have seen discussion above about the relative pros and cons of using one or the other. The problem is changing from one to the other in the middle of the discussion just results in confusion.
Editing has even resulted in the nonsense "Each of chopstick" in the problem statement.
On balance, and since the famous version of the problem as reworked by Tony Hoare refers to forks, we should use them. A sentence already exists explaining the cultural assumption that is being made. So, I propose:
"Five silent philosophers sit at a round table with bowls of spaghetti. A single fork is placed between each pair of adjacent philosophers. 
Each philosopher must alternately think and eat. However, a philosopher can eat spaghetti only when they have both the fork on their left and right. Each fork can be held by one and only one philosopher and so a philosopher can use them only if it is not being used by another philosopher. After an individual philosopher finishes eating, they need to put down both the forks in their original positions so that the forks become available to the others at the table. A philosopher can only take the fork on their right and the one on their left as they become available and they cannot start eating before getting both the forks.
Eating is not limited by the remaining amounts of spaghetti or stomach space; an infinite supply and an infinite demand are assumed.
The problem is how to design a discipline of behavior (a concurrent algorithm) such that no philosopher will starve; i.e., each can forever continue to alternate between eating and thinking, assuming that no philosopher can know when others may want to eat or think."  — Preceding unsigned comment added by Malpensilo (talk • contribs) 08:55, 27 October 2020 (UTC)
thread_title:  Forks + chopsticks = confusion 

message: 5 philosophers eating chow mein with chopsticks would make more sense than eating spaghetti with 2 forks as each person only has one chopstick.
Superdoggo (talk) 03:53, 16 March 2022 (UTC)
thread_title:  Why are forks used instead of chopsticks. 

message: The video in the lemma stops in the middle. Heronils (talk) 12:28, 15 October 2023 (UTC)
thread_title:  Video stops in the middle