# Rust atomics on x86: How and why

DevFeed: [Rust atomics on x86: How and why](<https://devfeed.tech/articles/rust-atomics-on-x86-how-and-why-35457.md>)

Original publisher: [Read original article](<https://darkcoding.net/software/rust-atomics-on-x86/>)

Author: Graham King

Published: 2022-01-30T23:18:06Z

Content type: article

Language: en

Sources: [Graham King](<https://devfeed.tech/sources/graham-king.md>)

Topics: [Rust](<https://devfeed.tech/topics/rust.md>), [x86](<https://devfeed.tech/topics/x86.md>), [ordering](<https://devfeed.tech/topics/ordering.md>)

Tags: [assembly](<https://devfeed.tech/tags/assembly.md>), [atomic](<https://devfeed.tech/tags/atomic.md>), [atomics](<https://devfeed.tech/tags/atomics.md>), [ordering](<https://devfeed.tech/tags/ordering.md>), [rust](<https://devfeed.tech/tags/rust.md>), [software](<https://devfeed.tech/tags/software.md>), [x86](<https://devfeed.tech/tags/x86.md>)

## AI overview

This article examines how Rust atomic memory orderings compile on x86. It finds that load and store operations generally produce the same instructions across orderings, while sequential consistency adds a full memory barrier. Read-modify-write operations also generally use the same instructions, though compiler reordering remains an important caveat.

## Source excerpt

On x86 it doesn't really matter what sync::atomic::Ordering you choose.