~/talk

Optimizing Multithreading Performance

Talkat Meeting C++ 2023 · 2023-11-12..11-14· [c-and-cpp]
links:none on file
slides:none on file

Shows that false sharing causes severe cache-line ping‑pong (benchmarks on a 10M-element sum and row vs column scans), demonstrates fixing it with 64‑byte alignment and alignas or padding, and recommends using the standard’s hardware_destructive_interference_size and C++17 parallel execution policies (transform/reduce, parallel sort) plus async/threadpool to avoid oversubscription. Gives concrete patterns that cause the issue, perf tools to find it, and measurable before/after speedups.

AI-written summary · about

  1. 0:00Introduction
  2. 1:03When to use multithreading
  3. 3:51Task vs data parallelism
  4. 7:22Multithreading overheads
  5. 10:17Multithreading risks
  6. 15:14CPU caches impact
  7. 21:26Cache misses and locality
  8. 25:38False sharing explained
  9. 32:04False sharing causes
  10. 37:51False sharing patterns
  11. 41:28C++ parallel algorithms
  12. 43:16Multithreading best practices
  13. 44:44Q&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.