That was how the previous implementation worked, and it was really slow. I tried one lock, then tried 32 locks with 32 buckets in the map, and they both tanked compared to the implemented lockless map. I don’t think we should switch until we have a solid replacement for gotomic.
I’m assuming that Go’s race detector can work fine with atomics. So, if it complains about a race condition in gotomic, it’s at least worth filing a bug against them, while we figure out whether we should be implementing our own.