I'm trying to kill a thread spawned this way:
Form1 spawns Class1 via Thread.start()
Here's my code to kill the thread:
If (t.ThreadState.ToString = "SuspendedRequested, WaitSleepJoin") Or
(t.ThreadState.ToString = "Suspended") Or (t.ThreadState.ToString =
"WaitSleepJoin, Suspended") Then
Else
t.Abort()
End If
The above runs when I close the application. The abort is hit and the main
form closes. Looking at the threads window, I can see the class spawned by
the thread is still active. It's suspend status is 1. It is also using
100% cpu. How can I debug why this thread will not die?
Thanks,
Brett 9 15131
If you want the background thread to die when the parent app closes just set
the threads background property to true before you start it.
"Brett" <no@spam.com> wrote in message
news:u4**************@tk2msftngp13.phx.gbl... I'm trying to kill a thread spawned this way: Form1 spawns Class1 via Thread.start()
Here's my code to kill the thread:
If (t.ThreadState.ToString = "SuspendedRequested, WaitSleepJoin") Or (t.ThreadState.ToString = "Suspended") Or (t.ThreadState.ToString = "WaitSleepJoin, Suspended") Then Else t.Abort() End If
The above runs when I close the application. The abort is hit and the
main form closes. Looking at the threads window, I can see the class spawned
by the thread is still active. It's suspend status is 1. It is also using 100% cpu. How can I debug why this thread will not die?
Thanks, Brett
If you want the background thread to die when the parent app closes just set
the threads background property to true before you start it.
"Brett" <no@spam.com> wrote in message
news:u4**************@tk2msftngp13.phx.gbl... I'm trying to kill a thread spawned this way: Form1 spawns Class1 via Thread.start()
Here's my code to kill the thread:
If (t.ThreadState.ToString = "SuspendedRequested, WaitSleepJoin") Or (t.ThreadState.ToString = "Suspended") Or (t.ThreadState.ToString = "WaitSleepJoin, Suspended") Then Else t.Abort() End If
The above runs when I close the application. The abort is hit and the
main form closes. Looking at the threads window, I can see the class spawned
by the thread is still active. It's suspend status is 1. It is also using 100% cpu. How can I debug why this thread will not die?
Thanks, Brett
Brett,
Does this thread help: http://groups-beta.google.com/group/...bbcf6fa6a59940
Hope this helps
Jay
"Brett" <no@spam.com> wrote in message
news:u4**************@tk2msftngp13.phx.gbl... I'm trying to kill a thread spawned this way: Form1 spawns Class1 via Thread.start()
Here's my code to kill the thread:
If (t.ThreadState.ToString = "SuspendedRequested, WaitSleepJoin") Or (t.ThreadState.ToString = "Suspended") Or (t.ThreadState.ToString = "WaitSleepJoin, Suspended") Then Else t.Abort() End If
The above runs when I close the application. The abort is hit and the main form closes. Looking at the threads window, I can see the class spawned by the thread is still active. It's suspend status is 1. It is also using 100% cpu. How can I debug why this thread will not die?
Thanks, Brett
No where in that post do I set the background property. If I try to do
this:
t.ThreadState.Background = True
I get this:
Constant cannot be the target of an assignment.
In summary, no - the the thread doesn't help.
Brett
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:eh**************@TK2MSFTNGP15.phx.gbl... Brett, Does this thread help:
http://groups-beta.google.com/group/...bbcf6fa6a59940
Hope this helps Jay
"Brett" <no@spam.com> wrote in message news:u4**************@tk2msftngp13.phx.gbl... I'm trying to kill a thread spawned this way: Form1 spawns Class1 via Thread.start()
Here's my code to kill the thread:
If (t.ThreadState.ToString = "SuspendedRequested, WaitSleepJoin") Or (t.ThreadState.ToString = "Suspended") Or (t.ThreadState.ToString = "WaitSleepJoin, Suspended") Then Else t.Abort() End If
The above runs when I close the application. The abort is hit and the main form closes. Looking at the threads window, I can see the class spawned by the thread is still active. It's suspend status is 1. It is also using 100% cpu. How can I debug why this thread will not die?
Thanks, Brett
Actually, I have the correct syntax and that seems to be working:
t.IsBackground = True
When the app is closing, I'm doing this:
If (t.ThreadState.ToString = "SuspendedRequested, WaitSleepJoin") Or
(t.ThreadState.ToString = "Suspended") Or (t.ThreadState.ToString =
"WaitSleepJoin, Suspended") Then
Else
t.Abort()
End If
That probably isn't needed anymore. The second thread is closing without
it, now that the background is set to true.
Thanks,
Brett
"Brett" <no@spam.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... No where in that post do I set the background property. If I try to do this: t.ThreadState.Background = True
I get this: Constant cannot be the target of an assignment.
In summary, no - the the thread doesn't help.
Brett
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message news:eh**************@TK2MSFTNGP15.phx.gbl... Brett, Does this thread help:
http://groups-beta.google.com/group/...bbcf6fa6a59940
Hope this helps Jay
"Brett" <no@spam.com> wrote in message news:u4**************@tk2msftngp13.phx.gbl... I'm trying to kill a thread spawned this way: Form1 spawns Class1 via Thread.start()
Here's my code to kill the thread:
If (t.ThreadState.ToString = "SuspendedRequested, WaitSleepJoin") Or (t.ThreadState.ToString = "Suspended") Or (t.ThreadState.ToString = "WaitSleepJoin, Suspended") Then Else t.Abort() End If
The above runs when I close the application. The abort is hit and the main form closes. Looking at the threads window, I can see the class spawned by the thread is still active. It's suspend status is 1. It is also using 100% cpu. How can I debug why this thread will not die?
Thanks, Brett
Brett,
Read the thread again: it states the IsBackground property, not the
background property. http://msdn.microsoft.com/library/de...roundtopic.asp
Hope this helps
Jay
"Brett" <no@spam.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... No where in that post do I set the background property. If I try to do this: t.ThreadState.Background = True
I get this: Constant cannot be the target of an assignment.
In summary, no - the the thread doesn't help.
Brett
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message news:eh**************@TK2MSFTNGP15.phx.gbl... Brett, Does this thread help:
http://groups-beta.google.com/group/...bbcf6fa6a59940
Hope this helps Jay
"Brett" <no@spam.com> wrote in message news:u4**************@tk2msftngp13.phx.gbl... I'm trying to kill a thread spawned this way: Form1 spawns Class1 via Thread.start()
Here's my code to kill the thread:
If (t.ThreadState.ToString = "SuspendedRequested, WaitSleepJoin") Or (t.ThreadState.ToString = "Suspended") Or (t.ThreadState.ToString = "WaitSleepJoin, Suspended") Then Else t.Abort() End If
The above runs when I close the application. The abort is hit and the main form closes. Looking at the threads window, I can see the class spawned by the thread is still active. It's suspend status is 1. It is also using 100% cpu. How can I debug why this thread will not die?
Thanks, Brett
Right, this will cause (the runtime I think) to kill the thread off when the
parent process dies.
The only thing you need to be careful of is what you are doing in that
thread. I am fairly certain that you have no control over what is being done
in that thread when it gets killed. If you are looping through a list for
instance your thread might die before the current loop is done.
"Brett" <no@spam.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl... Actually, I have the correct syntax and that seems to be working: t.IsBackground = True
When the app is closing, I'm doing this: If (t.ThreadState.ToString = "SuspendedRequested, WaitSleepJoin") Or (t.ThreadState.ToString = "Suspended") Or (t.ThreadState.ToString = "WaitSleepJoin, Suspended") Then Else t.Abort() End If
That probably isn't needed anymore. The second thread is closing without it, now that the background is set to true.
Thanks, Brett
"Brett" <no@spam.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... No where in that post do I set the background property. If I try to do this: t.ThreadState.Background = True
I get this: Constant cannot be the target of an assignment.
In summary, no - the the thread doesn't help.
Brett
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in
message news:eh**************@TK2MSFTNGP15.phx.gbl... Brett, Does this thread help:
http://groups-beta.google.com/group/...+thread+remain
+AbortRequested%3F+group:microsoft.public.dotnet.l anguages.vb&_done=%2Fgroup
s%3Fas_q%3DWhy+does+thread+remain+AbortRequested%3 F%26num%3D10%26scoring%3Dr
%26hl%3Den%26ie%3DUTF-8%26as_epq%3D%26as_oq%3D%26as_eq%3D%26as_ugroup%3D micr
osoft.public.dotnet.languages.vb%26as_usubject%3D% 26as_uauthors%3D%26lr%3D%2
6as_drrb%3Dq%26as_qdr%3D%26as_mind%3D1%26as_minm%3 D1%26as_miny%3D1981%26as_m
axd%3D28%26as_maxm%3D2%26as_maxy%3D2005%26safe%3Do ff%26&_doneTitle=Back+to+S
earch&&d#12bbcf6fa6a59940
Hope this helps Jay
"Brett" <no@spam.com> wrote in message news:u4**************@tk2msftngp13.phx.gbl... I'm trying to kill a thread spawned this way: Form1 spawns Class1 via Thread.start()
Here's my code to kill the thread:
If (t.ThreadState.ToString = "SuspendedRequested, WaitSleepJoin") Or (t.ThreadState.ToString = "Suspended") Or (t.ThreadState.ToString = "WaitSleepJoin, Suspended") Then Else t.Abort() End If
The above runs when I close the application. The abort is hit and the main form closes. Looking at the threads window, I can see the class spawned by the thread is still active. It's suspend status is 1. It
is also using 100% cpu. How can I debug why this thread will not die?
Thanks, Brett
It may not finish the entire loop but will finish the interaction it's in
correct?
Brett
"Ray Cassick" <rc******@nospam.enterprocity.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... Right, this will cause (the runtime I think) to kill the thread off when the parent process dies.
The only thing you need to be careful of is what you are doing in that thread. I am fairly certain that you have no control over what is being done in that thread when it gets killed. If you are looping through a list for instance your thread might die before the current loop is done.
"Brett" <no@spam.com> wrote in message news:%2****************@TK2MSFTNGP15.phx.gbl... Actually, I have the correct syntax and that seems to be working: t.IsBackground = True
When the app is closing, I'm doing this: If (t.ThreadState.ToString = "SuspendedRequested, WaitSleepJoin") Or (t.ThreadState.ToString = "Suspended") Or (t.ThreadState.ToString = "WaitSleepJoin, Suspended") Then Else t.Abort() End If
That probably isn't needed anymore. The second thread is closing without it, now that the background is set to true.
Thanks, Brett
"Brett" <no@spam.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... > No where in that post do I set the background property. If I try to do > this: > t.ThreadState.Background = True > > I get this: > Constant cannot be the target of an assignment. > > In summary, no - the the thread doesn't help. > > Brett > > "Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message > news:eh**************@TK2MSFTNGP15.phx.gbl... >> Brett, >> Does this thread help: >> >> http://groups-beta.google.com/group/...+thread+remain +AbortRequested%3F+group:microsoft.public.dotnet.l anguages.vb&_done=%2Fgroup s%3Fas_q%3DWhy+does+thread+remain+AbortRequested%3 F%26num%3D10%26scoring%3Dr %26hl%3Den%26ie%3DUTF-8%26as_epq%3D%26as_oq%3D%26as_eq%3D%26as_ugroup%3D micr osoft.public.dotnet.languages.vb%26as_usubject%3D% 26as_uauthors%3D%26lr%3D%2 6as_drrb%3Dq%26as_qdr%3D%26as_mind%3D1%26as_minm%3 D1%26as_miny%3D1981%26as_m axd%3D28%26as_maxm%3D2%26as_maxy%3D2005%26safe%3Do ff%26&_doneTitle=Back+to+S earch&&d#12bbcf6fa6a59940 >> >> >> Hope this helps >> Jay >> >> >> "Brett" <no@spam.com> wrote in message >> news:u4**************@tk2msftngp13.phx.gbl... >>> I'm trying to kill a thread spawned this way: >>> Form1 spawns Class1 via Thread.start() >>> >>> Here's my code to kill the thread: >>> >>> If (t.ThreadState.ToString = "SuspendedRequested, WaitSleepJoin") Or >>> (t.ThreadState.ToString = "Suspended") Or (t.ThreadState.ToString = >>> "WaitSleepJoin, Suspended") Then >>> Else >>> t.Abort() >>> End If >>> >>> The above runs when I close the application. The abort is hit and >>> the >>> main form closes. Looking at the threads window, I can see the class >>> spawned by the thread is still active. It's suspend status is 1. It is >>> also using 100% cpu. How can I debug why this thread will not die? >>> >>> >>> Thanks, >>> Brett >>> >> >> > >
I am not sure.
"Brett" <no@spam.com> wrote in message
news:eG**************@TK2MSFTNGP14.phx.gbl... It may not finish the entire loop but will finish the interaction it's in correct?
Brett
"Ray Cassick" <rc******@nospam.enterprocity.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... Right, this will cause (the runtime I think) to kill the thread off when the parent process dies.
The only thing you need to be careful of is what you are doing in that thread. I am fairly certain that you have no control over what is being done in that thread when it gets killed. If you are looping through a list
for instance your thread might die before the current loop is done.
"Brett" <no@spam.com> wrote in message news:%2****************@TK2MSFTNGP15.phx.gbl... Actually, I have the correct syntax and that seems to be working: t.IsBackground = True
When the app is closing, I'm doing this: If (t.ThreadState.ToString = "SuspendedRequested, WaitSleepJoin") Or (t.ThreadState.ToString = "Suspended") Or (t.ThreadState.ToString = "WaitSleepJoin, Suspended") Then Else t.Abort() End If
That probably isn't needed anymore. The second thread is closing
without it, now that the background is set to true.
Thanks, Brett
"Brett" <no@spam.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... > No where in that post do I set the background property. If I try to
do > this: > t.ThreadState.Background = True > > I get this: > Constant cannot be the target of an assignment. > > In summary, no - the the thread doesn't help. > > Brett > > "Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message > news:eh**************@TK2MSFTNGP15.phx.gbl... >> Brett, >> Does this thread help: >> >> http://groups-beta.google.com/group/...+thread+remain
+AbortRequested%3F+group:microsoft.public.dotnet.l anguages.vb&_done=%2Fgroup
s%3Fas_q%3DWhy+does+thread+remain+AbortRequested%3 F%26num%3D10%26scoring%3Dr
%26hl%3Den%26ie%3DUTF-8%26as_epq%3D%26as_oq%3D%26as_eq%3D%26as_ugroup%3D micr
osoft.public.dotnet.languages.vb%26as_usubject%3D% 26as_uauthors%3D%26lr%3D%2
6as_drrb%3Dq%26as_qdr%3D%26as_mind%3D1%26as_minm%3 D1%26as_miny%3D1981%26as_m
axd%3D28%26as_maxm%3D2%26as_maxy%3D2005%26safe%3Do ff%26&_doneTitle=Back+to+S earch&&d#12bbcf6fa6a59940 >> >> >> Hope this helps >> Jay >> >> >> "Brett" <no@spam.com> wrote in message >> news:u4**************@tk2msftngp13.phx.gbl... >>> I'm trying to kill a thread spawned this way: >>> Form1 spawns Class1 via Thread.start() >>> >>> Here's my code to kill the thread: >>> >>> If (t.ThreadState.ToString = "SuspendedRequested, WaitSleepJoin")
Or >>> (t.ThreadState.ToString = "Suspended") Or (t.ThreadState.ToString = >>> "WaitSleepJoin, Suspended") Then >>> Else >>> t.Abort() >>> End If >>> >>> The above runs when I close the application. The abort is hit and >>> the >>> main form closes. Looking at the threads window, I can see the
class >>> spawned by the thread is still active. It's suspend status is 1.
It is >>> also using 100% cpu. How can I debug why this thread will not
die? >>> >>> >>> Thanks, >>> Brett >>> >> >> > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jerry Sievers |
last post by:
Greetings Pythonists;
I have limited experience with threaded apps and plenty with old style
forked heavyweight multi-processing apps.
Using...
|
by: Jacek Popławski |
last post by:
Hello.
I am going to write python script which will read python command from
socket, run it and return some values back to socket.
My problem...
|
by: Brett |
last post by:
I'm trying to kill a thread spawned this way:
Form1 spawns Class1 via Thread.start()
Here's my code to kill the thread:
If...
|
by: Hans |
last post by:
Hi all,
Is there a way that the program that created and started a thread also stops
it.
(My usage is a time-out).
E.g.
thread =...
|
by: Thomas Dybdahl Ahle |
last post by:
Hi, I'm writing an application that connects to the internet.
Something like this:
for res in socket.getaddrinfo(host, port, 0,...
|
by: Teja |
last post by:
Hi all,
Can any on help me out in killing a thread (i.e deleteing the reources
like, stack ,memory etc) which is started with...
|
by: =?Utf-8?B?VGhlU2lsdmVySGFtbWVy?= |
last post by:
Because C# has no native SSH class, I am using SharpSSH. Sometimes, for
reasons I do not know, a Connect call will totally lock up the thread and...
|
by: Mathieu Prevot |
last post by:
Hi,
I have a threading.Thread class with a "for i in range(1,50)" loop
within. When it runs and I do ^C, I have the error as many as
loops. I...
|
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= |
last post by:
Hi misters,
Is it possible "kill" the thread of Backgroundworker ?
In my Dowork event, I have NOT While for do e.Cancel = true, only have a...
|
by: concettolabs |
last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
|
by: better678 |
last post by:
Question:
Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct?
Answer:
Java is an object-oriented...
|
by: teenabhardwaj |
last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
|
by: CD Tom |
last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
|
by: Arjunsri |
last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
| |