G
Guest
Hello All,
If I create a class based on Singleton design pattern, are the methods in
this class thread-safe?
Consider the following class:
Public class Singleton
{
public int Add(int a, int b)
{
}
}
If suppose I have a request A which calls the method with params as 1 and 2
and another request simultaneously calls the method with params as 3 and 4
Is there a possibility that the params are overrided as follows
--> Request A calls the method with params as 1 and 4
--> Request A calls the method with params as 3 and 2
Thanks for your suggestions!!!
If I create a class based on Singleton design pattern, are the methods in
this class thread-safe?
Consider the following class:
Public class Singleton
{
public int Add(int a, int b)
{
}
}
If suppose I have a request A which calls the method with params as 1 and 2
and another request simultaneously calls the method with params as 3 and 4
Is there a possibility that the params are overrided as follows
--> Request A calls the method with params as 1 and 4
--> Request A calls the method with params as 3 and 2
Thanks for your suggestions!!!