<img alt="" src="https://secure.leadforensics.com/150446.png " style="display:none;">


A lock-free and faster approach to get Singleton instance

The traditional way of implementing Singleton design pattern is given in Listing 1. The implementing class provides a static method which instantiates it if no instance already exist. This method is synchronized to ensure that not more than one thread can concurrently execute it and thereby create more than one instance of the class.

Topics: Java Singleton Multithreading Technology

e-Zest is a leading digital innovation partner for enterprises and technology companies that utilizes emerging technologies for creating engaging customers experiences. Being a customer-focused and technology-driven company, it always helps clients in crafting holistic business value for their software development efforts. It offers software development and consulting services for cloud computing, enterprise mobility, big data and analytics, user experience and digital commerce.