Re:Golang at CloudFlare
by brown9-2 on Tuesday July 03, 2012 @03:03PM
(#4195632)
When I run the second example on play.golang.org, the output I get is:
Why does the count alternate between 58 and 0?
[ Parent
| on HN ]
That's left as an exercise for the reader. Look at the channel synchronization and follow the code for both routines (the main and the goroutine). I'll admit in this case that it looks pretty deterministic, but in other cases it could be a different pattern.
Have a look at this, if it makes it any easier! http://play.golang.org/p/2s7S3BM6Oe