Given a singleton class injected via DI, what happens when multiple threads hit the singleton method
I have a very basic question:
Say I have below class which is registered as singleton, and a method. What happens when Create()
is hit by multiple threads? Do they all the threads get access to this method at same time? If 10 threads hit this method, does 10 numbers
variable get created and disposed off once the scope of method ends?