Introduction 介绍
The Go memory model specifies the conditions under which reads of a variable in one goroutine can be guaranteed to observe values produced by writes to the same variable in a different goroutine.
Go 内存模型指定了在一个 Goroutine 中读取变量时可以保证观察到在不同 Goroutine 中写入同一变量所产生的值的条件。
Advice 建议
Programs that modify data being simultaneously accessed by multiple goroutines must serialize such access.
修改由多个 goroutine 同时访问的数据的程序必须序列化此类访问。
To serialize access, protect the data with channel operations or other synchronization primitives such as those in the sync and sync/atomic packages.
要串行化访问,请使用通道操作或其他同步原语(例如 sync 和 sync/atomic 包中的同步原语)保护数据。
If you must read the rest of this document to und