What Can C++ Learn About Thread Safety From Other Languages?
summary
Argues C++ can borrow Rust/Swift ideas by adding send/sync traits and using C++26 reflection and metaclass generation to wrap types into synchronized_value, arc and copy‑on‑write wrappers; demonstrates a prototype "safe thread" library using concepts and reflection that forces shared_ptr+synchronized wrappers but is not bulletproof and produces heavy template errors and runtime overhead (TSAN-like costs reported as 5–15× slower, 5–10× memory); shows actors via senders/coroutines work and highlights remaining unsolved lifetime and aliasing cases.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:21Defining thread safety
- 3:35Multithreading landscapes
- 6:06Sync and send in C++
- 9:36The limitations of custom wrappers
- 16:50Comparing C++ to Rust
- 19:40Reflection for safety
- 24:23Metaclass generation
- 30:49Advanced concurrency patterns
- 40:04Actor models and runtime safety
- 46:22Future directions
related talks
01h 04mBack to Basics: Concurrency
01h 08mThinking Outside the Synchronisation Quadrant
47mConcurrent Programming in C++
01h 28mKeynote: Safety, Security, Safety and C / C++ - C++ Evolution
59mAn Introduction to Multithreading in C++20
01h 22mRust for the C++ Programmer
01h 08mBetter Code: Concurrency
45mThe existential threat against C++ and where to go from here
