
Dining philosophers problem
Five philosophers sit around a circular table. In front of each philosopher is a large plate of rice. The philosophers alternate their time between eating and thinking. There is one chopstick between each philosopher, to their immediate right and left. In order to eat, a given philosopher needs to use both chopsticks. How can you ensure all the philosophers can eat reliably without starving to death?
Un classico della teoria della programmazione concorrente spiegato da un esperto e chiarissimo Jeff Atwood, tratto dal suo celeberrimo blog "Coding Horror".
Non mancano riferimenti alle applicazioni reali come i DBMS.
0 commenti:
Posta un commento