Introduction to Thread-Safe Meyers Singleton

This lesson gives an introduction to a thread-safe version of Meyers singleton.

The C++11 standard guarantees that static variables with block scope will be initialized in a thread-safe way. The Meyers Singleton uses a static variable with block scope, so we are done. The only work that is left to do is to rewrite the previously used classical Meyers Singleton for the multithreading use-case.

Get hands-on with 1200+ tech skills courses.