Double Checked Locking

Intent: The Double-Checked Locking optimization AntiPattern reduces contention and synchronization overhead whenever CriticalSections of code need to acquire locks just once, but must be thread-safe when they do acquire locks.

Related Patterns: LockPattern

This is an AntiPattern because in most languages it doesn't work (DoubleCheckedLockingIsBroken, CppDoubleCheckLock).

See EffectiveJava by JoshuaBloch.

CategoryAntiPattern CategoryConcurrencyPatterns

View edit of August 30, 2004 or FindPage with title or text search