Skip to content
#

singleton-pattern

Here are 48 public repositories matching this topic...

We know that chickens hatch from eggs and eggs are laid by chickens. But the problem is "which came first: the chicken or the egg?" - Similar is the case of global objects creation - we are not sure which global variable is created first and which one after, when they are in different source files. Let's see how Singleton Design Pattern can solv…

  • Updated Jun 30, 2019
  • C++

This C++20 solution enables lazy initialization for multithreaded tasks. It efficiently initializes an expensive object only when needed, ensuring thread safety. It utilizes std::once_flag and std::atomic<bool> for synchronization, optimizing resource utilization and scalability.

  • Updated Apr 6, 2024
  • C++

Improve this page

Add a description, image, and links to the singleton-pattern topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the singleton-pattern topic, visit your repo's landing page and select "manage topics."

Learn more