Checking twice to avoid a lock
Lazy initialisation is written as: check whether the instance is null, take a lock if it is, check again, and construct.
Why was this famously broken in some languages?
Lazy initialisation is written as: check whether the instance is null, take a lock if it is, check again, and construct.
Why was this famously broken in some languages?