Questions tagged [dining-philosophers]

The dining philosophers problem is an example problem often used in concurrent algorithm design to illustrate synchronization issues and techniques for resolving them.

Filter by
Sorted by
Tagged with
3
votes
1answer
184 views

Go implementation of dining philosophers

Follow-up of this question. Questions: is this code a correct implementation of the Dining Philosophers problem? what is there to improve regarding Go Best Practices? ...
1
vote
1answer
890 views

Dining Philosopher's problem implementation with Java Locking Framework to avoid deadlock

Dining philosopher problem is one of the classic problems in computer science. I intended to implement it using Java threads. I attempted using the locking framework that came with Java 5 and used the ...
5
votes
1answer
1k views

Dining Philosopher correctness

How should I improve my solution for Dining Philosopher's problem? ...
5
votes
2answers
471 views

Dining Philosophers variation in C

This is a variation of the Dining Philosophers Problem. The task is to coordinate several students inside a gym. All students try to obtain their desired training weights from a shared weight rack. ...
3
votes
1answer
1k views

Attempt at solution for Dining Philosopher algorithm

I know there are a lot of different solutions to solve the "Dining Philosophers" problem, but I wanted to get some feedback on a solution that I have so far. My motivation for working on this is to ...
5
votes
1answer
532 views

Dining Philosophers using C11 threads

I wanted to try multithreading out in C, so I did Dining Philosophers using C11 threads with the approach of having one of the philosophers left-handed. Any suggestions? ...
1
vote
0answers
810 views

Dining philosophers using channels

I have the following code to solve dinning philosophers problem using Go channels and am looking for review comments: ...
7
votes
1answer
331 views

Dining Philosophers Problem in Clojure

I have implemented the Dining Philosophers Problem in Clojure with refs, trying to emphasize readability. Please point out if parts of it are inefficient, not idiomatic, or improvable in any way. Full ...
3
votes
1answer
281 views

Non-blocking solution to the dining philosophers

This is one of tasks, which I had to do for the recruitment process to be started in some company. Unfortunately they didn't like it so I've decided to share it here for discussion. Philo5.h ...
7
votes
3answers
11k views

Dining philosophers problem in C++11

Is this implementation correct? Do you find any threading problem? Also, what parts of the code can be changed to be more C++11-ish? ...
11
votes
3answers
7k views

Dining Philosophers Algorithm

I have written this program to solve this problem by Arbitrator solution algorithm, mentioned here, to solve this. It states that each philosopher should ask permission from ...
8
votes
3answers
26k views

Dining philosophers problem with mutexes

I know this dining philosophers problem has been researched a lot and there are resources everywhere. But I wrote simple code to solve this problem with C and then turned to the Internet to see if it'...
6
votes
1answer
43k views

Dining Philosophers problem solution with Java ReentrantLock

I have implemented the Dining Philosopher problem using ReentrantLock in Java. The goal of this program is: Every philosopher should follow the workflow of think, ...
10
votes
3answers
16k views

Dining Philosophers

I've just finished my solution to the Dining Philosopher's Problem, but I am not confident with my code because I am still newbie to the concurrency world. I would appreciate it if you could leave me ...