@@ -7,20 +7,20 @@ called ‘the dining philosophers’. It was originally conceived by Dijkstra in
77[ paper ] : http://www.usingcsp.com/cspbook.pdf
88
99> In ancient times, a wealthy philanthropist endowed a College to accommodate
10- > five eminent philosophers. Each philosopher had a room in which he could
11- > engage in his professional activity of thinking; there was also a common
10+ > five eminent philosophers. Each philosopher had a room in which she could
11+ > engage in her professional activity of thinking; there was also a common
1212> dining room, furnished with a circular table, surrounded by five chairs, each
1313> labelled by the name of the philosopher who was to sit in it. They sat
1414> anticlockwise around the table. To the left of each philosopher there was
1515> laid a golden fork, and in the centre stood a large bowl of spaghetti, which
16- > was constantly replenished. A philosopher was expected to spend most of his
17- > time thinking; but when he felt hungry, he went to the dining room, sat down
18- > in his own chair, picked up his own fork on his left, and plunged it into the
16+ > was constantly replenished. A philosopher was expected to spend most of her
17+ > time thinking; but when she felt hungry, she went to the dining room, sat down
18+ > in her own chair, picked up her own fork on her left, and plunged it into the
1919> spaghetti. But such is the tangled nature of spaghetti that a second fork is
2020> required to carry it to the mouth. The philosopher therefore had also to pick
21- > up the fork on his right. When he was finished he would put down both his
22- > forks, get up from his chair, and continue thinking. Of course, a fork can be
23- > used by only one philosopher at a time. If the other philosopher wants it, he
21+ > up the fork on her right. When she was finished she would put down both her
22+ > forks, get up from her chair, and continue thinking. Of course, a fork can be
23+ > used by only one philosopher at a time. If the other philosopher wants it, she
2424> just has to wait until the fork is available again.
2525
2626This classic problem shows off a few different elements of concurrency. The
0 commit comments