Last post Nov 08, 2005 03:24 AM by hurz
Nov 08, 2005 03:24 AM|hurz|LINK
I have an application which uses the cassini to provide web services.
While watching my application with the system monitor I realized that the application starts much more threads than I expected.
Therefore I wrote a very small application which creates an application host and sends a request to it.
The request is sent to the constructor of the class SimpleWorkerRequest as shown below:
public void Request (string request, TextWriter output)
requ = new SimpleWorkerRequest (request,
// HttpRuntime.ProcessRequest (requ);
At the moment I leave the method above (and switch back to the main AppDomain) I can see that the application starts a new thread.
If I uncomment the line where the request is processed and debug the code a new thread with highest priority is started at the moent I stepped over HttpRuntime.ProcessRequest (...).
When I leave the AppDomain of the ASP.NET application this thread disappears until I enter again to the ASP.NET domain.
When I unload the AppDomains of the ASP.NET the threads stay alive.
Does anybody know what exactly happens and how I can stop this newly creted threads when they are no more used?
Thanks a lot