# Learn about the C++ memory model for porting applications to Arm

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/servers-and-cloud-computing/arm-cpp-memory-model/)
- [Introduction to C++ Memory Models](https://learn.arm.com/learning-paths/servers-and-cloud-computing/arm-cpp-memory-model/1/)
- [The C++ Memory Model and Atomics](https://learn.arm.com/learning-paths/servers-and-cloud-computing/arm-cpp-memory-model/2/)
- [Walk through a Race condition example](https://learn.arm.com/learning-paths/servers-and-cloud-computing/arm-cpp-memory-model/3/)
- [Detecting race conditions](https://learn.arm.com/learning-paths/servers-and-cloud-computing/arm-cpp-memory-model/4/)
- [Next Steps](https://learn.arm.com/learning-paths/servers-and-cloud-computing/arm-cpp-memory-model/_next-steps/)

## About this Learning Path

|  |  |
| --- | --- |
| Skill level: | Advanced |
| Reading time: | 45 min |
| Last updated: | 11 Aug 2026 |

|  |  |
| --- | --- |
| Author: | Kieran Hejmadi , Arm<br>[GitHub](https://github.com/kieranhejmadi01)<br>[LinkedIn](https://linkedin.com/in/kieran-hejmadi-88920815b) |
| Arm IP: | [Neoverse](https://support.arm.com/?tab=compute-ip&Product%20Type=Infrastructure%20Processors) |
| Tags: | [Performance and Architecture](https://learn.arm.com/tag/performance-and-architecture/) [Arm AGI CPU](https://learn.arm.com/tag/arm-agi-cpu) [Linux](https://learn.arm.com/tag/linux) [CPP](https://learn.arm.com/tag/cpp) [TSan](https://learn.arm.com/tag/tsan) [Runbook](https://learn.arm.com/tag/runbook) |

### Who is this for?
This is an advanced topic for C++ developers porting applications from x86 to Arm and optimizing performance.

### What will you learn?
After completing this Learning Path, you'll be able to perform the following tasks:
- Describe at a high level what a memory model does, and the types of memory ordering.
- Describe the differences between the Arm and x86 memory model.
- Employ best practices for writing C++ on Arm to avoid race conditions.

### Prerequisites
Before starting, you'll need the following prerequisites:
- Access to an x86 Linux system and an Arm Linux system, such as a cloud instance or an Arm AGI CPU platform.
- Proficiency in C++ programming.

### Summary
You’ll explore the C++ memory model, see how compiler and hardware reordering interact with multithreaded code, and compare Arm and x86 memory ordering. First, you’ll examine atomics and memory ordering concepts before running a small concurrent C++ example on both x86 and Arm cloud instances to expose a race that can appear differently across architectures. Then, you’ll detect data races with ThreadSanitizer (TSan) and use its diagnostic output to guide fixes. By the end, you’ll be able to recognize code that relies on implicit x86 ordering and apply C++ best practices to write correct, portable concurrency for Arm.
