Relative Content

Tag Archive for c++multithreadingc++20atomicmemory-barriers

Lock-free thread safe lazy manual initialization of singleton in modern C++

I know Singleton is not good and that in general the thread safe lazy initialization in modern C++ can be done by static local variable, but I have quite specific use case and although I can use safer “less-performant” techniques(double check with mutex for the second check), I still would love to verify my understandings on atomic variables and memory ordering.

Lock-free thread safe lazy initialization of DLL/SO exported singleton in modern C++

I know Singleton is not good and that in general the thread safe lazy initialization in modern C++ can be done by static local variable, but I have quite specific use case and although I can use safer “less-performant” techniques(double check with mutex for the second check), I still would love to verify my understandings on atomic variables and memory ordering.