when a request starts, a processing thread is picked from the pool.
the request thread first job is to get an application object from the
application object pool. if none are free it creates one. when the
request finishes, the application object and request threads are
returned to their pools.
your timer will alway be running on a request thread, and may block any
request. if the same request thread creates two application objects
(different request same thread), then the time will be runnning more
than once on the same thread. it can also be running on two threads.
any response.end aborts the current request thread and will stop any
timer you started on that thread.
you probably want to start one background thread to do this. use locks
and a static or application start to only start only one background thread.
-- bruce (sqlwork.com)
> I've got the following skeleton in my HttpApplication (global.aspx) file:
>
[quoted text clipped - 22 lines]
>
> Thanks, Rob.
Rob - 29 Sep 2007 14:29 GMT
> when a request starts, a processing thread is picked from the pool.
I don't think this is an HTTP request - it's the core webapp's application
object, inherited from HttpApplication. It's called global.aspx but I think
that's a hangover from ASP v1, it can be called anything in ASP v2.
So I'm assuming that I'm adding a timer to the main application thread so I
wouldn't expect the request thread pool to be involved. But I am guessing.
Having an event take several seconds to run doesn't appear to cause dealing
of requests to slow significantly, i.e. the processing of requests via the
thread pool carries on as normal.
Cheers, Rob.