Problem Statement
Name three design techniques to achieve thread safety without heavy locking, and briefly explain why they help.
Explanation
1) Immutability: immutable objects can be shared freely—no races on state. 2) Confinement: keep mutable state confined to a single thread (e.g., ThreadLocal or task confinement) to avoid sharing. 3) Stateless functions and message passing: prefer pure functions; exchange data via queues, reducing shared mutable state. These reduce contention and simplify reasoning.