Answer 2 (new)
Complementing the general responses, I put an addendum, which in my view is considerable, and also practically reinforcing my first response:
As stated in the reply of Bruno Costa, the problem in question was formulated by Edsger W. Dijkstra in 1965.
With that, going back to where there were not as many programming languages as currently, and also resources of the most limited languages, really is a simple exercise to show problems in synchronizations (as it is said in the source itself).
Today with the wide range of resources and languages we have, the issue is in parts branched by ourselves due to ideas beyond the proposed context (a simple synchronization exercise).
On Wikipedia, you have all the history and solutions to the problem:
Dining philosophers problem
- Solution of resource hierarchy
That was the original solution proposed by Dijkstra, treating philosophers as processes and forks as resources.
Solution where there is an "arbiter" in the context, for example the waiter, who will give the permissions and orders to philosophers.
In 1984, K. Mani Chandy and J. Misra, gave the solution similar to arbitrary, but as long as philosophers spoke to each other, using "requests", that is, each philosopher would request the fork from his neighbor on the right and on the left, thus allowing, would have the 2 tools, and if not succeeding, could expect the request of another and borrow his own fork, not falling into deadlock.
Answer 1 (old) [ -2 ]
I will respond briefly from my point of view, with my words, that is, the line of thought is the same, but sometimes clear that we may have other paths.
what is the problem of gluttonous philosophers?
In my view, simply a great analogy, between process x resource, task x execution, or even more examples that we can fit.
what philosophers' dinner actually models?
A well-thought-out problem for a logical question. Yet, if applied in logic it would be easier to solve, since we control all paths.
how important it is to a programmer?
First of all, right from the start on "where to start to resolve the situation" and after, what the ways, and what the best.
when a programmer should care directly about this problem?
There’s the "X" of the question in my view. I understand that, very briefly, we should always have well defined the algorithm, not to enter the deadlock, as in the answer above.
That is, the importance of setting priorities, soon example, a list of tasks that must be performed but depends on each other (would be philosophers, who depend on forks), and then if everyone needs to be performed, which is the priority, That is, what has the power to pass in front ? Or for example, on a scale from 0 to 100, what is the priority level of that ?
Is there anything real and everyday that we run into this problem without knowing it? I don’t know, in a database?
An example with database: What is deadlock in SQL Server?
If anyone understands differently, please comment !
Extra points for anyone who can explain why they eat so much
– Jefferson Quesado
The point here is, where do they get so much spaghetti?
– lazyFox
@lazyFox, will be?!
– Jefferson Quesado
These things always remind me of this one deadlock on Avenida Brigadeiro Faria Lima with Avenida Juscelino Kubitschek, not so long ago: https://i.stack.Imgur.com/00DIk.jpg (also: http://mapio.net/pic/p-7122531/ )
– Bacco
@Jeffersonquesado This is easy, because being philosophers use gray matter and comes to a point that so much use is ready to eat :)
– IdkWhy
Downvoter, could you give me a reason to improve the issue?
– Jefferson Quesado
@Everson with hashis makes much more sense than with forks. Only those who ate pasta with Hashi to know. Great reference in the subject.
– Jefferson Quesado