
Barrier synchronization is a useful technique for developing programs
on parallel systems. This paper investigates algorithms that allow
disjoint subsets of processors to synchronize independently and in
parallel, where only the name of each barrier and the number of
participating processors in each barrier are known at compile time. We
introduce two general communication models: the {\em bounded buffer
broadcast model} and the {\em anonymous destination message passing
model}, and develop generic algorithms based on these models. Then we
adapt these generic algorithms to a real parallel system, the iWarp,
and analyze the complexities of the resulting algorithms.  The main
result is a counterintuitive time complexity of $O(\sqrt N)$ to
synchronize over a ring of $N$ processors. The performance analysis is
supported by measured execution time on real iWarp hardware.
