Varun Setia
What is Most Optimized Thread Safe Way To Lock Resources for Singleton Pattern?

Problem Statement is: the lock statement is used in case of implementing the Thread Safe Singleton Pattern.
The question is, we need to lock a resource but using a lock(x){} statement is bit expensive as per the interviewer. What is the most efficient or optimum way to lock a resource without using lock statement?

Is there any catch or trick in this question?

By Varun Setia in C# on Jul 26 2020

Most Popular Job Functions


MOST LIKED QUESTIONS