Synchronization and the Go memory model: Go course | Zoonk
28. Synchronization and the Go memory model
Protect shared state with mutexes, read-write mutexes, once values, condition variables, wait groups, and atomic operations. Use the Go memory model and happens-before relationships to judge whether concurrent code is correct.