in reply to Re: Multi-thread combining the results together
in thread Multi-thread combining the results together

Hi join is blocking
  • Comment on Re^2: Multi-thread combining the results together

Replies are listed 'Best First'.
Re^3: Multi-thread combining the results together
by roboticus (Chancellor) on Jul 25, 2019 at 13:55 UTC

    Anonymous Monk:

    Yes, but that's done after all the work has been queued. So the main thread simply waits for all the work to complete before exiting.

    In a "real" application, that would let your main thread collect some statistics and report before ending, to let you know what's going on.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

Re^3: Multi-thread combining the results together
by marioroy (Prior) on Jul 26, 2019 at 01:15 UTC

    In this similar example, joining (reaping workers) is done after obtaining results.