\begin{vdm_al}
class Philosopher
instance variables
theTable : Table;
turns : nat := 2
operations
public Philosopher : Table ==> Philosopher
Philosopher (pt) == theTable := pt;
Think: () ==> ()
Think () == skip;
Eat: () ==> ()
Eat () == turns := turns - 1;
thread
( while (turns > 0) do
( Think();
theTable.takeFork();
theTable.takeFork();
Eat();
theTable.releaseFork();
theTable.releaseFork() );
theTable.IamDone() )
end Philosopher
\end{vdm_al}
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet am 2026-11-24)
¤
*© Formatika GbR, Deutschland