Store→Load Reordering: x86 vs ARM64 Real-World Test

What really happens when CPUs reorder your instructions. Side-by-side experiment putting store→load reordering to the test on x86-64 and ARM64.

August 3, 2025
Harrison Guo
Video by: HarrisonSecurityLab
Published on YouTube: 2025-08-03
Memory Model x86 ARM64 Concurrency CPU Memory Fences Lock-Free

Same C code, two architectures, two different observable behaviors. x86-64’s TSO model hides store→load reordering most of the time; ARM64’s weaker model lets you see it directly. This video runs a minimal test that demonstrates the difference and prints the reorder count.

If you’ve written lock-free code that “worked on x86 but broke on ARM,” this is the underlying mechanism.

What the test shows

  • In the video: five runs per CPU. On the x86-64 Intel machine, one to five reorders appeared per half a million iterations. On ARM64, most runs showed about five to ten, with one run reaching 30. With a memory fence, both architectures showed none.
  • In the blog post’s ARM64 run over a million iterations, the both-zero outcome appeared ~2.3% of the time with no barrier, ~1.8% with only a compiler barrier, and 0.0% with a dsb sy fence. A compiler barrier alone does not fix it; you need a real CPU fence.

🎧 More Ways to Consume This Content

Comments

This space is waiting for your voice.

Comments will be supported shortly. Stay connected for updates!

Preview of future curated comments

This section will display user comments from various platforms like X, Reddit, YouTube, and more. Comments will be curated for quality and relevance.