In trying to understand this answer, I've found many similar questions and of course the docs but no explanation why.
Why is it that join
s called in main
can run parallel while join
s called in a loop in main
cannot?
In trying to understand this answer, I've found many similar questions and of course the docs but no explanation why.
Why is it that join
s called in main
can run parallel while join
s called in a loop in main
cannot?
Think of the sequence of events. It's the difference between
and
It should be obvious that, in the second case, the two threads never run at the same time.