How IIS manages reuests?
-
Hey guys, I'm writing an asp.net 3-tier application that uses data-source component, business-logic component and application component. The BL and the DS components are designed as singleton classes, so when clients request for data, they get the same BL object (and DS object) so IIS won't create multiply BLs/DS's objects. I want to know how the IIS manages the requests. if IIS will create a thread for each client there will be a race condition between those threads that want to run the same method. if so, I probably create the methods as "synchronized code region" which means that only one thread can enters a method at a time... do I need to get into it at all?... Thanks. Roy. p.s - I using visual studio.net 2003 and IIS 5.1
-
Hey guys, I'm writing an asp.net 3-tier application that uses data-source component, business-logic component and application component. The BL and the DS components are designed as singleton classes, so when clients request for data, they get the same BL object (and DS object) so IIS won't create multiply BLs/DS's objects. I want to know how the IIS manages the requests. if IIS will create a thread for each client there will be a race condition between those threads that want to run the same method. if so, I probably create the methods as "synchronized code region" which means that only one thread can enters a method at a time... do I need to get into it at all?... Thanks. Roy. p.s - I using visual studio.net 2003 and IIS 5.1
-
Roy Dont have your answer but maybe this help. When using IIS and webservice then the IIS "fire" a new thread for each SOAP function call. :confused:
-
Hey guys, I'm writing an asp.net 3-tier application that uses data-source component, business-logic component and application component. The BL and the DS components are designed as singleton classes, so when clients request for data, they get the same BL object (and DS object) so IIS won't create multiply BLs/DS's objects. I want to know how the IIS manages the requests. if IIS will create a thread for each client there will be a race condition between those threads that want to run the same method. if so, I probably create the methods as "synchronized code region" which means that only one thread can enters a method at a time... do I need to get into it at all?... Thanks. Roy. p.s - I using visual studio.net 2003 and IIS 5.1
-
the answer is very simple.. I just don't need to get into it :-D the IIS is smart enought to handle this problem. thank again all Roy.
Hi there, Just stumbles across this post. I can't see how IIS is *smart enough* to do this as the accessor to get a Singleton is static, so everyone has a chance to get it at the same time as you mention, the race condition. Therefore each client will obtain the singleton and have it within their HttpContext of their Session, and be able to access the same singleton concurrently. Won't they ?? regards, g00fy