~/talk

Lock-free programming with modern C++

Talkat ACCU 2017 · 2017-04-24..04-29· [c-and-cpp, concurrency]
links:none on file
slides:none on file

Uses C++11/14's std::atomic and the standard memory model to demonstrate a fixed-capacity ring buffer (size = N+1) implemented as a single-producer/single-consumer FIFO that is actually wait-free: push does an atomic store of the element then advances the index, pop loads then advances the index. Shows compare_exchange (strong/weak), is_lock_free, default sequentially-consistent ordering, and pitfalls with floats and nontrivial types. Extending to multiple consumers requires making per-slot accesses atomic or switching to pointer swaps plus explicit lifetime management; recommends using Boost.Lockfree or JUCE AtomicFIFO rather than reinventing it.

AI-written summary · about

  1. 0:00Introduction
  2. 1:54Overview
  3. 3:32Lock types
  4. 6:33Time constraints
  5. 12:26Lockfree guarantees
  6. 16:10Lock Reprogramming
  7. 20:01Atomic
  8. 25:17Floats
  9. 28:42Weak vs Strong
  10. 31:10Atomic vs Lockfree
  11. 32:38Is Lockfree
  12. 33:55Instances
  13. 35:44Why do they exist
  14. 36:59The code
  15. 39:41Exchange between threads
  16. 44:23Lockfree queue
  17. 47:39Dataraces
  18. 50:33Implementation
  19. 56:28Wait for you
~/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.