discovered the Barrier class, use it to simplify ParallelConsumer