concurrency question on HttpApplication,HttpModule, and Page

Discussion in 'ASP .Net' started by =?Utf-8?B?d2FsdGVy?=, Apr 25, 2006.

  1. 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.
     
    =?Utf-8?B?d2FsdGVy?=, Apr 25, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?d2FsdGVy?=

    Teemu Keiski Guest

    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" <> wrote in message
    news:D...
    > 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.
     
    Teemu Keiski, Apr 25, 2006
    #2
    1. Advertising

  3. 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" <> wrote in message
    > news:D...
    > > 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.

    >
    >
    >
     
    =?Utf-8?B?d2FsdGVy?=, Apr 25, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sherif ElMetainy
    Replies:
    7
    Views:
    506
    Alvin Bruney
    Nov 6, 2003
  2. Paul
    Replies:
    0
    Views:
    417
  3. Halcyon Woodward
    Replies:
    3
    Views:
    1,031
    Halcyon Woodward
    Jul 16, 2003
  4. Fernando Arámburu
    Replies:
    1
    Views:
    1,724
    Matt Berther
    Mar 24, 2005
  5. phil2phil

    httpcontext and httpapplication

    phil2phil, Jul 5, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    3,419
    Karl Seguin
    Jul 5, 2005
Loading...

Share This Page