Hands-on practice for this lecture. Work through the exercises and quizzes to reinforce what you've learned.
Exercise 1 of 2
A high-fidelity memory simulation. Monitor the Heap in real-time as you request instances, and witness the catastrophic impact of race conditions and security breaches.
Segment: HEAP_ALLOC_RANGE_0x00
Allocated: 0
Peak: 64.2 MB
Heap Unallocated
Technical Analysis
A correct Singleton should only ever result in one address in memory.Race conditions happen when thread synchronization fails.Security attacks (Reflection/Serialization) bypass the language rules to force-create new memory segments.
Exercise 2 of 2
Write the code for a Lazy Singleton. Choose the right checks and assignments to ensure "The One and Only" instance is born correctly.
Select the correct logic
Complete the lazy initialization ritual.