4 ms·
Oh, so cycleMap is a non-threadsafe structure? I don't know golang so I didn't realize this.
by senderista 2y ago
Oh, so cycleMap is a non-threadsafe structure? I don't know golang so I didn't realize this.
- kiitos 2y agoNothing in Go is thread-safe, unless explicitly documented otherwise. Some examples of explicitly-documented-otherwise stuff are in package sync and package sync/atomic. cycleMap is definitely not thread-safe. The authors knew this, to some extent, because they synchronized writes via an adjacent mutex. But they didn't synchronize reads thru the same mutex, which is the issue.
- senderista 2y agoOK, this doesn't inspire confidence then.