G
Guest
Hi.
I would like to know how a singleton object works. If you have a singleton
object, you have a single object ( brilliant! ). Within a process, if you
call X.Login() two or more times, and you don't have a shared resource within
the method called Login(), it's not necessary to synchronize the method call.
Suppose you have foo() as
int Login()
{
DataSet oDS = new DataSet();
oDS.DoSomething();
}
So, the question is how does it work when you have a singleton object, and
you call its method more than once at the same time?
If X.Login() is called twice immediately after another within a web
application, and X is a singleton, would there be a problem? Why?
Thanks.
J
I would like to know how a singleton object works. If you have a singleton
object, you have a single object ( brilliant! ). Within a process, if you
call X.Login() two or more times, and you don't have a shared resource within
the method called Login(), it's not necessary to synchronize the method call.
Suppose you have foo() as
int Login()
{
DataSet oDS = new DataSet();
oDS.DoSomething();
}
So, the question is how does it work when you have a singleton object, and
you call its method more than once at the same time?
If X.Login() is called twice immediately after another within a web
application, and X is a singleton, would there be a problem? Why?
Thanks.
J