What do you mean "thread-safe"?
summary
Defines an API race as two concurrent operations that violate an object's contract (broader than a data race), classifies types as thread-safe or thread-compatible (or not), and warns about thread-hostile functions that touch hidden shared state. Recommends documenting a type's classification, avoiding mutable members and hidden shared pointers, using mutexes or atomic-backed wrappers for shared state, and treating container elements as independent inputs only when you can take their address.
AI-written summary · about
chapters (8)
- 0:00Introduction to thread-safety
- 1:05What thread-safety really means
- 6:45Introducing API races
- 10:59Thread-safe vs thread-compatible types
- 20:20Thread-hostile functions
- 25:07Handling sub-objects in types
- 30:17Practical guidelines for thread-safety
- 46:16Q&A session
related talks
01h 04mBack to Basics: Concurrency
55mWhat Can C++ Learn About Thread Safety From Other Languages?
29mTackling Thread Safety in Python
42mLook out! Gotchas of Using Threads in Ruby
48mHandling concurrent access to shared resources in Java
45mThe Hidden Art of Thread-Safe Programming: Exploring java.util.concurrent
47mWhat All Rubyists Should Know About Threads
47mConcurrent Programming in C++
