I'm not advocate of multi-threading in ASP.NET - in most cases a better design can avoid the situation, and truth be known, I'm not an expert at multi-threading - everything I've multi-threaded has been in a fairly safe envrionment and was easy to deal with, however I've come across a situation that as far as I can tell calls for multi-threading. My question though is:
If I spawn a seperate thread in my application to kick off a long running process, and the main (originating) thread encounters an error or something that kills the aspnet_wp (say someone changed the web.config file) before the seperate thread is finished completing and joins back up with the main thread - will that other thread that was working now become lost memory? (Memory Leak).
Could I overcome this in the Application_Error event in Global by forcing a Thread.Join at this point? - Ditto for Application_End?.
What are some things to watch out for and code for in your experiance to keep from crashing the server?
Thanks!
If I spawn a seperate thread in my application to kick off a long running process, and the main (originating) thread encounters an error or something that kills the aspnet_wp (say someone changed the web.config file) before the seperate thread is finished completing and joins back up with the main thread - will that other thread that was working now become lost memory? (Memory Leak).
Could I overcome this in the Application_Error event in Global by forcing a Thread.Join at this point? - Ditto for Application_End?.
What are some things to watch out for and code for in your experiance to keep from crashing the server?
Thanks!