# CPU Out-of-Order Instruction Execution and Memory Ordering

DevFeed: [CPU Out-of-Order Instruction Execution and Memory Ordering](<https://devfeed.tech/articles/cpu-silently-disappointed-with-your-choice-of-instruction-ordering-35386.md>)

Original publisher: [Read original article](<https://darkcoding.net/software/cpu-silently-disappointed-with-your-choice-of-instruction-ordering/>)

Author: Graham King

Published: 2021-06-09T23:10:34Z

Content type: tutorial

Language: en

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

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

Tags: [cpu](<https://devfeed.tech/tags/cpu.md>), [ordering](<https://devfeed.tech/tags/ordering.md>), [rust](<https://devfeed.tech/tags/rust.md>), [software](<https://devfeed.tech/tags/software.md>)

## AI overview

A tutorial explores CPU out-of-order instruction execution through a two-thread example where both reads can observe zero. It discusses how the behavior is affected by cores, Rust memory ordering, and a Mutex.

## Source excerpt

An adventure in CPU out-of-order instruction execution.