- Beware of the optimizer!
- Beware of of sequenced before
- Message passing with release-acquire ordering
- Spinlock mutex
- How memory order maps to x86-64 and ARM64 assembly
- Sequential consistency: Dekker's algorithm simplified This demo intentionally fails due to weak/release-acquire order!
- Sequential consistency: Dekker's algorithm simplified even further This demo times out if it does not detect a violation with weak/release-acquire order!
- Producer/consumer broken
- Producer/consumer broken (no atomics)
- Producer/consumer fixed
- Producer/multiple consumers
- Dekker's algorithm with atomics vs fences, where the latter is probably correct?
- Dekker's algorithm failing with release/acquire
- How memory order maps to x86-64 and ARM64 assembly and optimizations
- How memory order may prevent auto vectorization
- Might fail in relaxed ordering (but not in x86's total store order model) -- at least one of the reader threads needs to fire
- atomic min/max in x86-64 or maybe weaker (no difference on x86)?
- sequential inconsistency:
- intro.multithread
- atomics.order
- atomics.fences
- Atomic minimum/maximum (P0493R3)
- Anthony Williams: Implementing Dekker's algorithm with Fences
- std::atomic_thread_fence
- std::atomic
- Order of evaluation: "Sequenced before" rules
- Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 3A: System Programming Guide, Part 1: Chapter 9.2 Memory Ordering
- Neither Loads Nor Stores Are Reordered with Like Operations
- Stores Are Not Reordered With Earlier Loads
- Loads May Be Reordered with Earlier Stores to Different Locations
- Atomic Smart Pointers (N4058)
- C++ Concurrency in Action, Anthony Williams, 2nd ed.
- Revising atomic_shared_ptr for C++20 (P0718R2)
- Does lock xchg have the same behavior as mfence?
- Repairing sequential consistency in C/C++11, Ori Lahav et al. (2017) PDF
- Common Compiler Optimisations are Invalid in the C11 Memory Model and what we can do about it, Viktor Vafeiadis et al. (2015) PDF
- How to miscompile programs with "benign" data races, Hans-J. Boehm (2011) PDF
- The C11 and C++11 Concurrency Model, Mark John Batty (2014)
- Cooperating Sequential Processes, E.W. Dijkstra (1968) PDF
- The synchronization of independent processes, L. Lamport, Acta Informatica 7, 15–34 (1976) PDF
- How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs, L. Lamport, IEEE Transactions on Computers, vol. C-28, no. 9, pp. 690-691, Sept. 1979 PDF
- A Primer on Memory Consistency and Cache Coherence Daniel J. Sorin et al. (2011) PDF
- Revising the C++ memory model (P0668R5)
- Analyzing the memory ordering models of the Apple M1 Lars Wrenger et al. (2024)
- How emulation works on Arm (Windows 11 24H2's emulator Prism), see also Visual Studio 2019's /volatileMetadata
- Memory consistency and event ordering in scalable shared-memory multiprocessors Kourosh Gharachorloo et al. (1990)
- Promising 2.0: global optimizations in relaxed memory concurrency Sung-Hwan Lee et al. (2020)
- High context switch rate, learn.microsoft.com
- Measuring context switching and memory overheads for Linux threads, Eli Bendersky (2018)
- ACCU 2017: Frank Birbacher Atomic's memory orders, what for?
- C++ and Beyond 2012: Herb Sutter Atomic Weapons 1 of 2
- C++ and Beyond 2012: Herb Sutter Atomic Weapons 2 of 2
- CppCon 2014: Herb Sutter Lock-Free Programming (or, Juggling Razor Blades), Part I
- CppCon 2014: Herb Sutter Lock-Free Programming (or, Juggling Razor Blades), Part II
- CppCon 2017: Fedor Pikus C++ atomics, from basic to advanced. What do they really do?
- CppCon 2015: Fedor Pikus Live Lock-Free or Deadlock (Practical Lock-free Programming) PART 1
- CppCon 2015: Fedor Pikus Live Lock-Free or Deadlock (Practical Lock-free Programming) PART 2
- CppCon 2016: Hans Boehm Using weakly ordered C++ atomics correctly
- CppCon 2021: Filipe Mulonde The Foundation of C++ Atomics: The Knowledge You Need to Correctly Use C++ Atomics
- ADC 2022: Timur Doumler Thread synchronisation in real-time audio processing with RCU (Read-Copy-Update)
- Pavel Yosifovich Concurrency and the C++ Memory Model
- CppCon 2020: Paul E. McKenney & Hans Boehm A Relaxed Guide to memory_order_relaxed
- CppCon 2016: JF Bastien No Sane Compiler Would Optimize Atomics
- FOWM'24: Stephen Dolan Why Languages Should Preserve Load-Store Order
- FOWM'24: Hans-J. Boehm What we learned from C++ atomics and memory model standardization
- Hydra 2022: Ori Lahav Weak memory concurrency in C/C++11
- CppCon 2018: Paul McKenney, Maged Michael The Landscape and Exciting New Future of Safe Reclamation for High Performance
- CppCon 2021: Maged Michael Hazard Pointer Synchronous Reclamation Beyond Concurrency TS2