By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,894 Members | 2,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,894 IT Pros & Developers. It's quick & easy.

Killing off a thread..

P: n/a
Hi all

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?

Thanks
Kev
Sep 28 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hello, Mantorok!

MI have an app that runs report classes, each report is run in a new
Mthread,
Mwhat I want is the ability to be able to kill of a thread that is
Mrunning.

MHow is this best achieved?

Have a look at the following article
( http://msdn.microsoft.com/msdnmag/is...03/NETMatters/ )
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Sep 28 '06 #2

P: n/a
"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
Sep 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.