Quantcast
Channel: golang concurrency sync issue - Stack Overflow
Browsing latest articles
Browse All 2 View Live

Answer by JimB for golang concurrency sync issue

You're never waiting for the "hive" loop to finish, so sometimes you print the count value before it's complete. It's easiest to use the WaitGroup to signal when to close the channel, and block main on...

View Article



golang concurrency sync issue

I am facing a synchronization issue when using goroutines. My program outputs unpredictable results. I checked the docu and for unbuffered channels there is no way to check if all msgs have been...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images