Singleton pattern in web applications

Posted by ryudice on Stack Overflow See other posts from Stack Overflow or by ryudice
Published on 2010-03-07T22:39:47Z Indexed on 2010/03/07 23:11 UTC
Read the original article Hit count: 797

Filed under:
|
|
|

I'm using a singleton pattern for the datacontext in my web application so that I dont have to instantiate it every time, however I'm not sure how web applications work, does IIS open a thread for every user connected? if so, what would happend if my singleton is not thread safe? Also, is it OK to use a singleton pattern for the datacontext? Thanks.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET