~/talk

User API & C++ Implementation of a Multi Producer, Multi Consumer, Lock Free, Atomic Queue

Talkat CppCon 2024 · on Tuesday, 2024-09-17· at 09:00· Adams A, 6700 North Gaylord Rockies Boulevard· [web-performance]
slides:none on file

Lock-free MPMC queue implemented in C++17 std::atomic, uses a circular array of fixed-size, cacheline-aligned entries, no heap allocation at runtime, and a 16-byte atomic compare‑and‑swap trick (cmpxchg16b / 128‑bit CAS) to atomically flip entry state and data. Benchmarks report up to 703M msgs/s (single‑producer/single‑consumer on a laptop) and sub‑microsecond round‑trip latency; tested on Intel/AMD, supports unique_ptr wrappers for larger payloads, and is available on GitHub.

AI-written summary · about

  1. 0:00Lock-free multi-producer queue intro
  2. 1:29Low-latency queue requirements
  3. 7:22Fat tails performance impact
  4. 17:51Hardware atomics for queues
  5. 22:53Atomics not always lock-free
  6. 25:22Lock-free queue design
  7. 31:34Queue API and examples
  8. 42:28Push and pop operations
  9. 46:31Testing and validation
  10. 49:23Performance benchmarks
  11. 51:34Future work and optimizations
  12. 54:32Summary and questions
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.