472,110 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,110 software developers and data experts.

Easy Thread Question

I dont know much about threads, so please be easy on explaining me this one.

How do I stop a thread completelly (kill it)?

What happens with a thread that has been started but not killed?

The reason I am asking this is that one of my applications does not removed
from the Task Manager even though I close all my forms and call explicitly
Applicaton.exit at the end. I was thingking the thread inside it might be
the reason. If not, what else could be the reason it just stays hanging in
the Task Manager?

Thank you,

--
Dino Buljubasic
Software Developer
http://rivusglobal.com
Nov 20 '05 #1
4 2936
hi, i used to have this kinda problem but after i use

(assumming you are writing windows form application)
Private Sub form1_Closed(ByVal sender As Object, ByVal e
As System.EventArgs) Handles MyBase.Closed
End
End Sub

everything terminate properly....
-----Original Message-----
I dont know much about threads, so please be easy on explaining me this one.
How do I stop a thread completelly (kill it)?

What happens with a thread that has been started but not killed?
The reason I am asking this is that one of my applications does not removedfrom the Task Manager even though I close all my forms and call explicitlyApplicaton.exit at the end. I was thingking the thread inside it might bethe reason. If not, what else could be the reason it just stays hanging inthe Task Manager?

Thank you,

--
Dino Buljubasic
Software Developer
http://rivusglobal.com
.

Nov 20 '05 #2
Cor
Dino,
I thought that threads are not killed directly is by design (if it is not a
real crazy thing), the framework kills it after a while.
The "thread".abort exist. But that does not remove it direct from memory.
Why the program not is clossing, is for me impossible to see from here.
Cor
Nov 20 '05 #3
That is what I thought too but it is the only possible problem I can see.

It is closing, all my forms get closed, but the blue square in IDE tool menu
is still shown and the application is still in Task Manager.

Thanks for your help

--
Dino Buljubasic
Software Developer
http://rivusglobal.com

"Cor" <no*@non.com> wrote in message
news:3f***********************@reader21.wxs.nl...
Dino,
I thought that threads are not killed directly is by design (if it is not a real crazy thing), the framework kills it after a while.
The "thread".abort exist. But that does not remove it direct from memory.
Why the program not is clossing, is for me impossible to see from here.
Cor

Nov 20 '05 #4
Hello,

"Dino M. Buljubasic" <di*************@rivusglobal.com> schrieb:
How do I stop a thread completelly (kill it)?

What happens with a thread that has been started but not
killed?

[...]

You may want to set a boolean flag that is checked by the tread before
exitting. This flag will tell the thread to exit. 'Thread.Abort' usually
should not be used, the thread should kill itself.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Harold Howe | last post: by
5 posts views Thread by AC | last post: by
6 posts views Thread by Matt Long | last post: by
1 post views Thread by melanieab | last post: by
22 posts views Thread by Morpheus | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.