Thread Safety

Noun · Development

Definitions

  1. The property of code that guarantees correct behavior when accessed by multiple threads simultaneously, achieved through techniques like locks, atomic operations, immutable data, or confinement — preventing race conditions, data corruption, and torn reads.

    In plain English: Code is thread-safe when multiple parts of a program can use it at the same time without causing errors or corrupted data.

    Example: "That singleton isn't thread-safe — two threads can both see null and create separate instances."

Related Terms