"Mantorok" <ma******@mantorok.comwrote in message
I have an app that runs report classes, each report is run in a new
thread, what I want is the ability to be able to kill of a thread that is
running.
How is this best achieved?
You really can't kill threads - doing will have all sorts of ugly results.
A better approach is to have an event of some sort, usually a
ManualResetEvent, called "_shouldShutdown". Have your worker threads poll
this event periodically, and if the event is set then have the thread exit.
--
Chris Mullins, MCSD.NET, MCPD:Enterprise
http://www.coversant.net/blogs/cmullins