thread-safe static methods in ASP.NET?

P

PJ6

I'm looking for some examples specific to ASP.NET that show how to serve
data from a singleton instance to multiple sessions in a thread-safe manner.
Any suggestions?

TIA,
Paul
 
J

Joerg Jooss

PJ6 said:
I'm looking for some examples specific to ASP.NET that show how to
serve data from a singleton instance to multiple sessions in a
thread-safe manner. Any suggestions?

Don't. Singletons don't scale across clusters and if they require
locking, they might become nasty bottlenecks. Can you explain that
requirement's background a bit?

Cheers,
 
P

PJ6

Joerg Jooss said:
Don't. Singletons don't scale across clusters and if they require
locking, they might become nasty bottlenecks. Can you explain that
requirement's background a bit?

Certainly. See the thread with the subject "using AJAX when class instances
get disposed after load".

I just decided to avoid complicating my project too much by making the
remote-scripted DB updating mechanism in my grid control stateless.

But that aside I think it would still be nice to use singletons to serve
data to data-consuming controls. But maybe I should abandon that idea
altogether for now. I don't exactly need to do it.

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top