~/talk

An introduction to multithreading in C++20

Talkat Meeting C++ 2022 · 2022-11-17..11-19· [kubernetes, devops-and-delivery]
slides:none on file

Starts with concrete tools and rules: use std::jthread (destructor calls request_stop and joins), cooperate with stop_token/stop_source for cancellation, prefer parallel algorithms and transform_reduce for large-data speedup, or a thread-pool for many small tasks. Gives an Amdahl example: 90% parallel yields only ~9.9× on 1000 cores. Covers latches, barriers, futures/promises, condition_variable_any, semaphores and atomics, warns mutexes hurt scalability and that a standard thread pool is not yet in the standard.

AI-written summary · about

  1. 0:00Multithreading in C++20
  2. 1:04Choosing concurrency model
  3. 5:46Amdahl's law for scalability
  4. 9:24Parallel algorithms with policies
  5. 13:37Thread pools for tasks
  6. 17:29Cooperative cancellation with stop tokens
  7. 24:31Managing threads with jthread
  8. 33:03Synchronizing shared data
  9. 35:08Latches for thread sync
  10. 40:24Barriers for loop sync
  11. 46:01Futures and promises
  12. 52:45Mutexes and locks
  13. 55:36Condition variables
  14. 57:44Semaphores for sync
  15. 59:33Atomics for lock-free
  16. 1:01:19Summary
~/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.