What Can C++ Learn About Thread Safety From Other Languages?
summary
Prototype safe concurrency library implements Rust/Swift-style send/sync concepts with heavy use of C++ type traits and experiments in reflection and metaclass code generation, demonstrating a working proof-of-concept for constrained thread arguments and synchronized_value wrappers but finding many escape hatches (capturing lambdas, leaked addresses, nested pointers). Experiments show actors via C++26 senders + coroutines and copy‑on‑write metaclasses are feasible; runtime checks with TSAN or an extrinsic storage scope checker give practical detection today, but full safety needs borrow‑checker style lifetimes.
AI-written summary · about
chapters (17)
- 0:00Introduction and background
- 2:11Thread safety importance
- 7:26Thread safety in other languages
- 8:49Sync and send concepts
- 12:03Implementing send in C++
- 16:17Implementing sync in C++
- 22:23Limitations of current C++ approach
- 25:39Solving nested pointers with reflection
- 28:46Metaclasses for thread safety
- 34:05Swift-style automatic reference counting
- 36:30Swift structs and copy-on-write
- 41:51Review of sync and send
- 45:31Actors in C++ with metaclasses
- 51:09Runtime checks with T-San
- 59:00Data race detection in standard library
- 1:00:04Future outlook for C++ thread safety
- 1:02:34Q&A
