I am looking for a design pattern where the parent thread will spawn multiple child threads. Each child thread will perform some computation and return an appropriate result.
The parent thread will be waiting for the child threads to complete. After all child threads are completed, the consolidated result will be sent to the parent thread.
The parent thread will then proceed with consolidated result.
future
?cyclic barrier
is intended for use as repeatable waiting of one or more threads. For wait one-short thread(s)join
is sufficient. - Tsyvarev