Go Concurrency Patterns
›
Chapter 3
Chapter 3
Synchronization Primitives
Use sync.Mutex, sync.WaitGroup, and other synchronization tools
✓ Protect shared state with mutexes
✓ Coordinate goroutines with WaitGroup
✓ Use sync.Once for initialization
1
Mutex Basics
Protect shared state with sync.Mutex and sync.RWMutex
Effective Go
+20 XP
intermediate
2
WaitGroup
Coordinate goroutine completion with sync.WaitGroup
Effective Go
+15 XP
beginner
3
Sync.Once
Run initialization code exactly once with sync.Once
Effective Go
+15 XP
beginner
← Back to Course
Start Chapter →