\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.31 Sekunden
(vorverarbeitet)
¤
|
schauen Sie vor die Tür
Fenster
Die Firma ist wie angegeben erreichbar.
Die farbliche Syntaxdarstellung ist noch experimentell.
|