On Monday, August 15, 2022 at 5:20:58 AM UTC-4 ma...@changkun.de wrote: > > Any other reading, to me, is trying to find an ambiguity for the sole > sake of finding an ambiguity. > > A reader does not have to be motivated to find ambiguity. If the > sentence can be interpreted with different meanings, other readers may > perceive it differently. To me, the first read of this sentence is > perceived to be ambiguous regarding a single location or multiple > locations. The posted example discusses a and b as two memory > locations. > > Atomic operations on a and b are two different statements. It remains > unclear where exactly is the sentence that tries to say this: atomic > operations on different memory locations obey the program statements > order within a goroutine. >
Doesn't the Section on Atomics <https://go.dev/ref/mem#atomic> statement say just that: The APIs in the sync/atomic <https://go.dev/pkg/sync/atomic/> package are collectively “atomic operations” that can be used to synchronize the execution of different goroutines. If the effect of an atomic operation *A* is observed by atomic operation *B*, then *A* is synchronized before *B*. All the atomic operations executed in a program behave as though executed in some sequentially consistent order. Is your confusion about the term "observed"? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/3a266d04-db5c-4e16-bf1e-3ea6c7a98168n%40googlegroups.com.