Implementing a cyclicbarrier in java using semaphores
问题 The question is as follows, since the barrier is only called using down() so that it would wait for the n threads to arrive and then execute all n threads together in the critical region now how do I inform the threads calling on barrier.down that it can move on now. I tried adding notifyAll() after phase2() and that doesn't work. Help? :) public class cyclicBarrier { private int n; private int count; private semaphore mutex; private semaphore turnstile; private semaphore turnstile2; public