C++ Atomics: The Sad Story of memory_order_consume: A Happy Ending At Last?
Play C++ Atomics: The Sad Story of memory_order_consume: A Happy Ending At Last?
C++ Atomics: The Sad Story of memory_order_consume: A Happy Ending At Last? — Presentation Slides, PDFs, Source Code and other presenter materials are available at: https://github.com/cppcon/cppcon2015 — One of the big advantages of C++ atomics is that developers can now let the compiler know about the intent behind their multi-threaded synchronization mechanisms. At least they can tell the compiler as long as the synchronization mechanism in question is not RCU. You see, all production compilers promote RCU's memory_order_consume to memory_order_acquire. Although this promotion does ensure correctness, it also ensures the additional overhead of memory-barrier instructions on weakly ordered systems and of needlessly suppressed compiler optimizations on all systems. All previous attempts to resolve this issue have foundered on either standard-committee reluctance to eviscerate the standard for a special case, compiler-writer reluctance to eviscerate their compilers for a special case, and kernel-developers reluctance to eviscerate their source base for late-to-the-party compiler support. But now there is a glimmer of hope in the guise of a small set of small patches to the Linux kernel that eliminate the most challenging use cases. Will this hope be realized? Come to this talk to here the story, which by September will hopefully have a happy ending! — Paul E. McKenney: Distinguished Engineer, IBM Linux Technology Center Low-level concurrency in applications and kernels written in C and C++. — Videos Filmed & Edited by Bash Films: http://www.BashFilms.com