systemes-concurrents/TP1/question1/rdv.xta
Raphaël LACROIX f570469914 los fichios
2023-03-31 14:13:28 +02:00

29 lines
No EOL
675 B
Text

/* Probleme du choix distant */
chan s, a, b, f;
process Left{
state idle, choice, after_a, after_b, reinit;
urgent idle, choice, after_a, after_b, reinit;
init idle;
trans idle -> choice{sync s!; },
choice -> after_a{sync a!; },
choice -> after_b{sync b?; },
after_a -> reinit{},
after_b -> reinit{},
reinit -> idle{sync f?; };
}
process Right{
state idle, choice, after_a, after_b, reinit;
urgent idle, choice, after_a, after_b, reinit;
init idle;
trans idle -> choice{sync s?; },
choice -> after_a{sync a?; },
choice -> after_b{sync b!; },
after_a -> reinit{},
after_b -> reinit{},
reinit -> idle{sync f!; };
}
gauche := Left();
droit := Right();
system gauche, droit;