This one is ascending. Please note the modification of line 20:

<goog_1633918978>
https://play.golang.org/p/qB8jCyVAJc9

The reason the first one is not is that you start the two threads virtually 
at the same time, so when they come up for execution, they are neck and 
neck and timing probably depends on the hardware, what else is running, 
etc.  If you sleep one thread by .5 seconds at first  instead of 1, now the 
threads do not come up out of sleep at the same time, and lo and behold, 
output is now ascending. 


On Monday, April 8, 2019 at 6:30:34 AM UTC-7, go je wrote:
>
> https://play.golang.org/p/0TIxVFuqGoB
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to