Thread Safety in Singleton

In this article,we will discuss

  • Lazy Initialization in Singleton
  • How to use Multi-threads in Singleton
  • How to implement a Thread Safe singleton class

Please go through my previous article to learn about singleton design pattern.

Lazy Initialization in Singleton : GetInstance Property is responsible for the Singleton Instance creation. Singleton object is not instantiated until and unless GetInstance is invoked. Hence, there is a delay in instance creation till the GetInstance is accessed. This Delay in Instance creation is called Lazy Initialization. Continue reading “Thread Safety in Singleton”

Blog at WordPress.com.

Up ↑

Design a site like this with WordPress.com
Get started