sync/atomic package
Package docs for low-level atomic operations and typed atomic values in Go.
Package docs for low-level atomic operations and typed atomic values in Go.
- Author: Go Team
- Authority: primary
- Kind: package-doc
- URL: https://pkg.go.dev/sync/atomic
What it covers
- atomic load store swap compare-and-swap
- typed atomic wrappers
- atomic API constraints
Why authoritative
Official low-level API docs for atomic operations in Go.
Use when
- should this use sync/atomic
- is this atomic operation correct in Go
- when are atomics better than mutexes in Go
Keywords
- atomic, sync/atomic, lock-free, memory ordering, concurrency