class CollegeCircuit implements CSProcess{
public void run(){
One2OneChannelInt PhiltoCanteen[] = new One2OneChannelInt[5];
One2OneChannelInt CanteentoPhil[] = new One2OneChannelInt[5];
One2OneChannelInt CheftoCanteen = new ONe2OneChannelInt;
Phil phillist[] = new Phil[5];
for(int k = 0; k < 5; k++){
PhiltoCanteen[k] = new One2OneChannelInt();
CanteentoPhil[k] = new One2OneChannelInt();
}
for(int k = 0; k < 5; k++)
phillist[k] = new Phil(k, PhiltoCanteen[k],
CanteentoPhil[k]);
new Parallel( new CSProcess[]{
new Parallel(phillist),
new Chef(CheftoCanteen),
new Canteen(PhiltoCanteen, CanteentoPhil, CheftoCanteen)
}).run();
} }
Previous slide | Next slide | Back to first slide | View graphic version |