Checkpoint synchronization: Difference between revisions

(→‎{{header|Tcl}}: Added zkl)
Line 2,252:
foreach id in (NUM_PARTS){ producer.launch(id,pipe) } // start workers/threads
 
product:=NUM_PARTS.pump(List(),False); // parts I have on hand
do(10){ // make 10 products
product:=NUM_PARTS.pump(List(),False); // parts I have
while(False!=(id:=product.filter1n('!=(True)))){ // gather parts to make product
requested.set(id);
Line 2,260:
}
println("product made: ",product);
product.clearforeach n in (NUM_PARTS);{ product[n]=False } // no parts in bin
}
println("Done"); // but workers are still waiting</lang>
Anonymous user