Barrier Synchronization
with Coordinator
Andrews Text page 119
process Worker[i=1 to n]{
while(true){
code to implement task i;
arrive[i]=1;
<await(continue[i]==1);>
continue[i] = 0;
}
}
process Coordinator{
while(true) {
for[i=1 to n]{
<await(arrive[i] ==1);>
arrive[i] =0;
}
for [i=1 to n] continue[i] =0;
}
}