Registration is now open for CppCon 2026! The conference starts on September 12 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year's conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2026!
Beyond Sequential Consistency: Unlocking Hidden Performance Gains
by Christopher Fretz
Summary of the talk:
In 2011, C++ introduced a formally defined memory model, providing a foundation for portable, multi-threaded code with well-defined correctness guarantees. This was a major milestone, enabling expressive threading primitives and safe concurrency patterns while allowing low-level optimizations for performance.
By default, C++ atomics enforce sequential consistency, which ensures intuitive, predictable behavior. However, these strong guarantees often exceed what’s necessary for correctness and come with a performance cost.
This talk delves into weaker memory orderings, particularly acquire/release and relaxed semantics, using a ring buffer as a practical example of how they can be used. We’ll also examine how the C++ memory model maps to real hardware, focusing on x86’s native guarantees, and comparing against less coherent platforms like ARM. We'll explore how strategic use of weaker synchronization can unlock significant performance gains without sacrificing correctness.

Add a Comment
Comments are closed.