4 ms·
How are you tmusing close to synchronize channels? Close doesn't block. It looks like a race condition, the workers might try to write their start messages aft
by Evbn 14y ago
How are you tmusing close to synchronize channels? Close doesn't block.
It looks like a race condition, the workers might try to write their start messages after main closes the channel.
http://golang.org/ref/spec#Close http://golang.org/ref/spec#Close
- jgrahamc 14y agoAssuming you are talking about slide 7 I'm not trying to synchronize I'm just using the closing of the start channel as a signal to the goroutines that they can start their work. Clearly, it's not guaranteed that all the <- start's have failed before close() returns.