Contents
How is the dining philosophers problem used in Computer Science?
In computer science, the dining philosophers problem is an example problem often used in concurrent algorithm design to illustrate synchronization issues and techniques for resolving them. It was originally formulated in 1965 by Edsger Dijkstra as a student exam exercise, presented in terms…
How to solve the dining philosophers problem with concx?
ConcX provided all the tools and the necessary framework to solve the Dining Philosophers problem. The philosophers all shared their forks and got to eat an approximately even number of times and none of them starved. “Wait!!”
Is the resource hierarchy solution of the dining philosophers problem fair?
The resource hierarchy solution is not fair. If philosopher 1 is slow to take a fork, and if philosopher 2 is quick to think and pick its forks back up, then philosopher 1 will never get to pick up both forks.
Can a philosopher sit at the edge of the table?
Transactions == philosophers. So in this example the transactions (philosopher) can not only sit at the edge of the table between two accounts (forks), but also on a line cutting across the table, connecting any two accounts (forks).
Can a philosopher eat with only one fork?
A fork can only be used by one philosopher at a time. However in order to eat, two forks are required – fork in one’s left and right. A philosopher can take an available fork but is not allowed to eat unless the philosopher has both his left and right forks.
How does eating philosophers solve the starvation problem?
If another philosopher had previously requested one of the forks, the philosopher that has just finished eating cleans the fork and sends it. This solution also allows for a large degree of concurrency, and will solve an arbitrarily large problem. It also solves the starvation problem.