Its a very important Low Level System Design interview question.
There are 2 Memory issues present in Double Checked Locking Solution of Singleton Pattern.
Instruction Reordering issue
Caching Issue
I have explained the double checked locking in previous Video: • 27. All Creational Design Patterns | Proto...
Chapters:
00:00 - Introduction
02:32 - Issue1 (Instruction Reordering Issue)
08:59 - Issue2(L1 Caching Issue)
13:47 - Fix(Usage of Volatile keyword)
#systemdesign #lowleveldesign #singleton