Atomic Shared Memory Undefined Behavior
Building Robust Inter-Process Queues in C++ think-cell Daugaard: Shared State class RingBuffer // Writer and reader's shared positions. struct alignas(CACHE_LINE_SIZE) SharedState { std::atomic<size_t> pos; }; SharedState m_WriterShared; std::atomic<T>::atomic atomic() noexcept = default; constexpr atomic() noexcept(std::is_nothrow_default_constructible_v<T>); constexpr atomic(T desired) noexcept; atomic(const atomic&) = delete; (since C++11) (until C++20) (since C++20) (since C++11) Jody Hagins 118
A bald presenter stands beside a laptop while a conference slide shows C++ code for shared state in an inter-process ring buffer, focusing on std::atomic. The audio delivers the punchline that code using atomics in shared memory is technically undefined behavior, turning a serious programming talk into a dry, devastating reaction to broken low-level code. EN: A bald presenter stands beside a laptop while a conference slide shows C++ code for shared state in an inter-process ring buffer, focusing on std::atomic. The audio delivers the punchline that code using atomics in shared memory is technically undefined behavior, turning a serious programming talk into a dry, devastating reaction to broken low-level code.
So all the code that is on the internet that is using stdutomic in shared memory is now technically undefined behavior.
- @ithueti / 16666 2025-08-22
- Type
- video, 0:08
- Size
- 1280×720 · 5.9 MiB
- Mood
- dry, absurd
- Language
- en
- Added