in reply to Re: Threading and join/termination question
in thread Threading and join/termination question
Anyway when I ran this, I still only got 0 1 2 3 in the last line of output, so it was missing 4 and 5. Thinking maybe the script was terminating before the threads finished, I tried adding
after the for loop. That took care of it. Interestingly, I first tried .1 for the sleep argument and only got the 4. I don't understand that. Doesn't seem like a push should take that long.while (threads->list()) { sleep 1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Threading and join/termination question
by choroba (Cardinal) on Aug 01, 2014 at 13:11 UTC |