NOTE

2.3 sync

An overview of the synchronization primitives provided by Go's sync package and links to Mutex, RWMutex, Cond, Once, Map, Pool, WaitGroup, and atomic.

GoCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

1. What It Is

Provides basic synchronization primitives. Except for Once and WaitGroup, most are intended for low-level libraries. high-level synchronization generally uses channels.

2. What It Contains

2.1. Locker

  • An interface
  • Has Lock and Unlock methods

2.2. Mutex

sync.Mutex.md

2.3. RWMutex

sync.RWMutex.md

2.4. Cond

sync.Cond.md

2.5. Once

sync.Once.md

2.6. Map

sync.map.md

2.7. Pool

sync.pool.md

2.8. WaitGroup

sync.WaitGroup.md

2.9. atomic Package

atomic.md

3. References

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub