Thread safety

It is piece of code is safety executed to manipulate shared data by multiple thread at the same time.

Implementation Approaches

Thread-local storage: Variables are localized

Immutable object: State of object cannot be changed after construction

Mutual Exclusion: no concurrent process, e.g. Locking

Atomic Operation: e.g. version