[concurrency-interest] Is there something like an ordered or counting barrier

Oliver Zeigermann ozeigermann@apache.org
Wed, 29 Dec 2004 01:09:05 +0100


I was struggeling to make some multi threaded test scenarios
deterministic and was looking for something that lets me determine the
sequence of steps distributed over the threads. My idea was not to let
step n be executed before step n-1.

I know CountDownLatch and CyclicBarrier, but they both do not seem to
help me in that scenario.

Because of that I made up a tiny class that does this for me


and wanted to know if there are more elegant ways to do so and if this
makes sense in the first place.

Thanks for any hints and comments,