~/talk

Get Off My Thread: Techniques for Moving Work to Background Threads

Talkat CppCon 2020 · 2020-09-14..09-18· [concurrency]
slides:none on file

Argues that spawning a thread per event is hopeless and recommends either a dedicated background thread for ordered single threaded processing or a thread pool for scalable parallelism with explicit continuations to preserve ordering. Shows practical tools and patterns: std::thread std::jthread std::async stop token style cancellation via stop_token for cooperative cancellation, counting pending tasks plus atomic wait for shutdown, and posting GUI messages or eventfd to marshal progress updates back to the event loop.

AI-written summary · about

  1. 0:00Intro
  2. 0:48Why do we need to move work off the current thread?
  3. 5:04Aside: Non-Blocking vs Lock-free
  4. 10:05Spawning new threads
  5. 11:37Managing thread handles
  6. 27:58Thread pools: upsides
  7. 29:42Thread pools: downsides
  8. 34:49Addressing thread pool downsides
  9. 39:42Cancellation: Stop tokens
  10. 42:22Cancellation: Counting outstanding tasks
  11. 49:37Coroutines: example
  12. 52:52Guidelines
~/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.