The Go runtime has quite a few places where it assumes atomic load/store behavior of int sized words as well as the eventual propagation of the stores.
I always get a little anxious when looking at such code. But it seems to work well in practice?
I always get a little anxious when looking at such code. But it seems to work well in practice?
"...each read of a single-word-sized or sub-word-sized memory location must observe a value actually written to that location"
It works in practice because it's a requirement of the implementation.