I need to execute some amount of tasks 4 at a time, something like this:
ExecutorService taskExecutor = Executors.newFixedThreadPool(4); while(...) { tas
The CyclicBarrier class in Java 5 and later is designed for this sort of thing.