Thread-safe
A function or data structure that can be called from multiple threads simultaneously without undefined behavior.
A function is thread-safe if all threads can run it in parallel without corrupting shared state. This can be achieved through immutability (no thread changes data), locking (a mutex protects access), or lock-free algorithms (atomic operations coordinate access).
Thread-safety is a spectrum, not binary: a function can be thread-safe for reads but not writes, or thread-safe for certain input types but not others. Often you must read documentation carefully to understand exactly which operation sequences are safe.