468,765 Members | 1,005 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

concurrency question on HttpApplication,HttpModule, and Page

Hi there, I know there is pool of HttpApplications, and for each request
coming in, HttpRuntime will dedicate one from pool to serve the request. My
questions are :
1. since HttpModule is plug into the process, does each instance of
HttpApplication keep its own set of HttpModule instance or HttpModules are
shared among all HttpApplication instances?

2. In case of HttpApplication keep its own set of HttpModule, does the
HttpModule collection get created for each request or just once and reusable
later for all the following request? In the latter case , we need to handle
the class level field carefully.

3.When I have a particular web folder which need a additional set of
HttpModule, I guess I can add them into the Web.Config within that folder.
But is ASP.NET smart enough to remove them when the request is for the other
folders?

4. Last one is whether Page object is pooled in ASP.NET. I guess the answer
is no.
Apr 25 '06 #1
2 4310
Hi,

1. Each instance has its own set of HTTP Modules. HTTP modules are set up so
that they listen events thrown by HttpApplication

2. They are reused (created once per HttpApplication)

3. Settings in web.config are inherited, so if it is a root folder where
modules are set,subfolder uses the same set, unless overridden in sub-
web.config

4. This is determined by Page's IHttpHandler.IsReusable property, which, by
default, is false (it was once commented by MS guys, that making a class
which would be reusable in this case, would take extreme care by the
developer so that it would really be cleared at the end of every request, so
it really is easier to let it recreate instances.) In case you need
performance, or it sucks, then develop your own HTTP handler

Good resource: http://msdn2.microsoft.com/en-US/library/ms178473.aspx

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"walter" <ww*@morneausobeco.com> wrote in message
news:DB**********************************@microsof t.com...
Hi there, I know there is pool of HttpApplications, and for each request
coming in, HttpRuntime will dedicate one from pool to serve the request.
My
questions are :
1. since HttpModule is plug into the process, does each instance of
HttpApplication keep its own set of HttpModule instance or HttpModules are
shared among all HttpApplication instances?

2. In case of HttpApplication keep its own set of HttpModule, does the
HttpModule collection get created for each request or just once and
reusable
later for all the following request? In the latter case , we need to
handle
the class level field carefully.

3.When I have a particular web folder which need a additional set of
HttpModule, I guess I can add them into the Web.Config within that folder.
But is ASP.NET smart enough to remove them when the request is for the
other
folders?

4. Last one is whether Page object is pooled in ASP.NET. I guess the
answer
is no.

Apr 25 '06 #2
Hi Teemu, your answer is great. The only one is the Web.Config question. My
question is the reverse-- Sub folder need the httpmodule , but root/other
folders do not. Wondering if asp.net can maintain the httpmodule list
properly in this case.

Any idea ?

"Teemu Keiski" wrote:
Hi,

1. Each instance has its own set of HTTP Modules. HTTP modules are set up so
that they listen events thrown by HttpApplication

2. They are reused (created once per HttpApplication)

3. Settings in web.config are inherited, so if it is a root folder where
modules are set,subfolder uses the same set, unless overridden in sub-
web.config

4. This is determined by Page's IHttpHandler.IsReusable property, which, by
default, is false (it was once commented by MS guys, that making a class
which would be reusable in this case, would take extreme care by the
developer so that it would really be cleared at the end of every request, so
it really is easier to let it recreate instances.) In case you need
performance, or it sucks, then develop your own HTTP handler

Good resource: http://msdn2.microsoft.com/en-US/library/ms178473.aspx

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"walter" <ww*@morneausobeco.com> wrote in message
news:DB**********************************@microsof t.com...
Hi there, I know there is pool of HttpApplications, and for each request
coming in, HttpRuntime will dedicate one from pool to serve the request.
My
questions are :
1. since HttpModule is plug into the process, does each instance of
HttpApplication keep its own set of HttpModule instance or HttpModules are
shared among all HttpApplication instances?

2. In case of HttpApplication keep its own set of HttpModule, does the
HttpModule collection get created for each request or just once and
reusable
later for all the following request? In the latter case , we need to
handle
the class level field carefully.

3.When I have a particular web folder which need a additional set of
HttpModule, I guess I can add them into the Web.Config within that folder.
But is ASP.NET smart enough to remove them when the request is for the
other
folders?

4. Last one is whether Page object is pooled in ASP.NET. I guess the
answer
is no.


Apr 25 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Samuel | last post: by
3 posts views Thread by Michael Iantosca | last post: by
7 posts views Thread by nail | last post: by
3 posts views Thread by Joseph Geretz | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.