4 ms·
Using channels where mutexes would suffice has by far been the main cause of bad concurrent code I've encountered. Using more than 2 'semantic' channels plus o
by Groxx 2y ago
Using channels where mutexes would suffice has by far been the main cause of bad concurrent code I've encountered.
Using more than 2 'semantic' channels plus one ctx.Done() channel? There's probably a bug. So far that has been well over 50% accurate, across dozens of libraries.
When they're used like this, chans often break into non-blocking algorithm details, because they don't ensure mutual exclusion. And non-blocking algorithms are freakin hard - few things are guaranteed without great care.