Thread-Safe Singleton: Atomics
This lesson explains the solution for the thread-safe initialization of singleton problem using atomics in C++.
We'll cover the following...
With atomic variables, my implementation becomes a lot more challenging; I can even specify the memory model for my atomic operations. The following two implementations of the thread-safe singletons are based on the previously mentioned double-checked locking pattern.
...