import java.util.concurrent.CountDownLatch; public class Processes implements Runnable { private CountDownLatch latch; public Processes(CountDownLatch l) { latch = l; } public void run() { try { latch.await(); } catch (Exception e) { } } public static void main(String args[]) { int N = 1000; CountDownLatch[] ls = new CountDownLatch[N]; long start = System.currentTimeMillis(); for (int i = 0; i