Closed mfranzreb closed 1 week ago
i'm not sure what your expectations are here. by the end of the run, each thread would have been run the same number of iterations because the iterations are set at the outer loop level.
Hi, thank you for the reply! Just wanted to know if there was a built-in way to have all threads stop executing once the first thread is done. The question is settled now though.
As this issue explains, in a multi-threaded benchmark, the threads are synchronized before starting the loop, and after exiting, but not during the iterations. In the following example, the results show that
t_1 == t_2
. How does this then work? My thought is that the number of iterations is set before the loop starts, is this correct? Is there a built-in functionality to have all threads stop once the first is finished? Thank you for the help!