~/talk

Designing an SPSC Lock free queue

Talkat Meeting C++ 2025 · 2025-11-06..11-08· [rust]
links:none on file
slides:none on file

A concrete design surfaces: a working SPSC lock-free queue implemented with atomic head/tail indices, wraparound via power-of-two capacity (capacity = 2^N) and guarded against false sharing by 64-byte alignment. The page lists both blocking push/pop (mutex + condition_variable) and nonblocking try_push/try_pop using atomic loads/stores with acquire/release ordering and CAS where needed; examples show the head/tail increment logic and that the bounded circular buffer behaves correctly under single-producer single-consumer conditions.

AI-written summary · about

  1. 0:00Lock-free queues intro
  2. 1:45Threads vs processes in C++
  3. 9:19Thread creation in C++
  4. 15:53Race conditions and mutex
  5. 21:37Deadlocks and livelocks
  6. 29:37Producer-consumer problem
  7. 36:05Thread-safe queue design
  8. 45:41Lock-free queue implementation
  9. 56:43Q&A
~/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.