Timing threads in an algorithm
You are probably looking for a barrier synchronization primitive.  Each thread calls into the barrier when it is done creating its set.  Only when all the threads have called into the barrier are any threads permitted to proceed.

If your programming language doesn't include a barrier primitive, then you can fake it, in your example, simply by having the main thread sit in a loop and join with all the children thread as the children finish and return from their computation.  The loop should only exit when it sees every child thread finish.