In my main programme, i start three threads as described below
Thread 1:- having steps 1A and 1B
Thread 2:- having steps 2A and 2B
Thread 3:- having steps 3A and 3B
I want Thread 1, 2 and 3 proceed for their next step only when all of them complete their first step.
For example:- Thread 2 and Thread 3 have completed their first steps i.e 2A and 3A respectively but Thread1 did not complete step 1A. So thread 2 and 3 will wait till thread 1 complete step 1A
I know i can handle it with simple static counter and only proceed once counter value is 3. But i am sure there must be something off the shelve available in thread/java.util.concurrent package?