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

Terminating a thread

P: n/a
Hi

I am using the Suspend method to terminate a thread but it seems that after
calling that method the IsLive property is still set to True

Is there another way to terminate a thread from the program?

Thank you in advance
Shmuel Shulman
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Try:

Thread.Abort()
Nov 21 '05 #2

P: n/a
"S Shulman" <sm*******@hotmail.com> schrieb:
I am using the Suspend method to terminate a thread but it seems that
after calling that method the IsLive property is still set to True

Is there another way to terminate a thread from the program?


How To Stop a Thread in .NET (and Why 'Thread.Abort' is Evil)
<URL:http://www.interact-sw.co.uk/iangblog/2004/11/12/cancellation>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

P: n/a
I'm a little concerned about the title of and some of the language used in
the article you highlighted.

While I agree totally with the gist of the article I see the the phrase
"'Thread.Abort' is Evil" as being inappropriate.

Yes, it can be dangerous if is not used properly or used without
understanding what it actually does, but, as the author points out, it is
actually quite appropriate and, indeed, desirable to use it under certain
circumstances.

Now, there a number of readers who will know that you know what you are
talking about and assume that you agree that "'Thread.Abort' is Evil" and
will be guided by that. Whether you do endorse it or not is largely
irrelevant. It's a matter of readers perceptions. As we have all seen in the
past, such perceptions can easily lead to subsequent posts that contain
mis-information and misunderstandings, and, I think you will agree, such
posts are not helpful and can have undesirable consequences.

I wonder if it might be prudent that, when one posts a link to an article
that could be considered 'controversial', that one gives a comment as to the
fact that it might not be the only answer and/or whether or not the article
is endorsed by the poster.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uo****************@tk2msftngp13.phx.gbl...
"S Shulman" <sm*******@hotmail.com> schrieb:
I am using the Suspend method to terminate a thread but it seems that
after calling that method the IsLive property is still set to True

Is there another way to terminate a thread from the program?


How To Stop a Thread in .NET (and Why 'Thread.Abort' is Evil)
<URL:http://www.interact-sw.co.uk/iangblog/2004/11/12/cancellation>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

P: n/a
Bravo and well said!!
"Stephany Young" <noone@localhost> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I'm a little concerned about the title of and some of the language used in
the article you highlighted.

While I agree totally with the gist of the article I see the the phrase
"'Thread.Abort' is Evil" as being inappropriate.

Yes, it can be dangerous if is not used properly or used without
understanding what it actually does, but, as the author points out, it is
actually quite appropriate and, indeed, desirable to use it under certain
circumstances.

Now, there a number of readers who will know that you know what you are
talking about and assume that you agree that "'Thread.Abort' is Evil" and
will be guided by that. Whether you do endorse it or not is largely
irrelevant. It's a matter of readers perceptions. As we have all seen in
the past, such perceptions can easily lead to subsequent posts that
contain mis-information and misunderstandings, and, I think you will
agree, such posts are not helpful and can have undesirable consequences.

I wonder if it might be prudent that, when one posts a link to an article
that could be considered 'controversial', that one gives a comment as to
the fact that it might not be the only answer and/or whether or not the
article is endorsed by the poster.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uo****************@tk2msftngp13.phx.gbl...
"S Shulman" <sm*******@hotmail.com> schrieb:
I am using the Suspend method to terminate a thread but it seems that
after calling that method the IsLive property is still set to True

Is there another way to terminate a thread from the program?


How To Stop a Thread in .NET (and Why 'Thread.Abort' is Evil)
<URL:http://www.interact-sw.co.uk/iangblog/2004/11/12/cancellation>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.