4 ms·
> there's 1 mutex to read the channel, not 1 per backend Fewer mutexes isn't necessarily an advantage, there will be far higher contention on that single mutex
by biggestdecision 7y ago
> there's 1 mutex to read the channel, not 1 per backend
Fewer mutexes isn't necessarily an advantage, there will be far higher contention on that single mutex.
Channel writes also require a lock.
- kitd 7y agoOne to read, and a single reader thread. That's no contention. One to write, that's used for writing only, not both read/write as in the published design. Edit: it's a variation on the following, but for ReverseProxies, not worker goroutines http://marcio.io/2015/07/handling-1-million-requests-per-minute-with-golang/ http://marcio.io/2015/07/handling-1-million-requests-per-min...