Hacker News new | ask | show | jobs
by senderista 460 days ago
Oh, so cycleMap is a non-threadsafe structure? I don't know golang so I didn't realize this.
1 comments

Nothing 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.

OK, this doesn't inspire confidence then.