|
![]() |
The "dining philosophers" problem is a classical exercise in the teaching of concurrent programming. The goal is to avoid deadlocks.
We have provided an illustration of the solution using ProActive, where all the philosophers are active objects, as well as the table (controller) and the dinner frame (user interface).
with philosophers.sh or philosophers.bat
ProActive creates a new node and instantiates the active objects of the application : DinnerLayout, Table, and Philosopher
the GUI is started.
Philosophers |
![]() |
philosophing |
![]() |
hungry, wants the fork ! | |
![]() |
eating | |
Forks |
![]() |
taken |
![]() |
free |
The application runs by itself without encountering a deadlock.
Click on the philosophers' heads to switch their modes
Test that there are no deadlocks!
Test that you can starve one of the philosophers (i.e. the others alternate eating and thinking while one never eats!)
IC2D is a graphical environment for monitoring and steering of distributed and metacomputing applications.
- being in the autopilot mode, start the IC2D visualization application (using ic2d.sh or ic2d.bat)
the ic2d GUI is started. It is composed of 2 panels : the main panel and the events list panel
- acquire you current machine
menu monitoring - monitor new RMI host
It is possible to visualize the status of each active object (processing, waiting etc...), the communications between active objects, and the topology of the system (here all active objects are in the same node) :