IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

atomic

Atomic operations and memory orderings.

The atomic package provides the Atomic type for performing atomic read-modify-write operations on scalar values, along with the Ordering type for specifying the memory ordering of those operations. It also exposes the fence function to create standalone memory barriers.

Use this package when implementing lock-free data structures, reference counting, or any other synchronization primitive that requires fine-grained control over memory ordering between threads.

Modules