Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2005

Tip: Looking for answers? Try searching our database.

Threads: how to kill

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
xzzy - 29 Oct 2005 06:13 GMT
foreach(Thread t in clsStaticVARS.threadHolder.Values)
 {
   If (t.Name == Name )
     {
       if (!t.IsAlive)
         {
           threadHolder.Remove(t.Name);
           break;
         }
     }
 }//end foreach

Where clsStaticVARS.threadHolder is defined as:

   private static Hashtable _threadHolder = new Hashtable();
   public static Hashtable threadHolder { get { return _threadHolder;} set
{ _threadHolder = value; } }

PROBLEM:
 In the above foreach, how do I actually kill the thread?

Thank you,

John Bickmore
Kevin Spencer - 29 Oct 2005 12:25 GMT
Threads kill themselves generally, when they finish executing, just as a
function is removed from the stack when it is finished executing. You can
call the Abort() method on the thread if necessary. Note that this will
raise a ThreadAbortException, which you will have to handle.

Signature

HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
A watched clock never boils.

> foreach(Thread t in clsStaticVARS.threadHolder.Values)
>  {
[quoted text clipped - 20 lines]
>
> John Bickmore
Juan T. Llibre - 29 Oct 2005 12:52 GMT
re:
> Threads kill themselves generally

Not the "VB.NET vs. C#" threads...

<g, d & r>

Juan
====

> Threads kill themselves generally
Kevin Spencer - 30 Oct 2005 04:44 GMT
I had no idea that threading was different with VB.Net. It sounds absurd on
the face of it, but I have never known you to say crazy things, Juan, so I
may have to look into that.

Signature

HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
A watched clock never boils.

> re:
>> Threads kill themselves generally
[quoted text clipped - 7 lines]
>
>> Threads kill themselves generally
Juan T. Llibre - 30 Oct 2005 13:06 GMT
Either I needed to insert a smilie instead of <g, d & r>
or you are the best stone-faced legpuller I've ever seen.

;-)

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
>I had no idea that threading was different with VB.Net. It sounds absurd on the face of
>it, but I have never known you to say crazy things, Juan, so I may have to look into
>that.

>> re:
>>> Threads kill themselves generally
[quoted text clipped - 7 lines]
>>
>>> Threads kill themselves generally
Kevin Spencer - 30 Oct 2005 15:38 GMT
You were right in the first part, Juan. Even though I have been known as a
cunning linguist, I completely missed your play on words! Maybe I need to
take a day off...

I have never seen that particular combination of symbols. What does it mean,
BTW?

P.S. Thanks for saving me the trouble of checking out your joke!
Signature


Kevin Spencer
Microsoft MVP
.Net Developer
A watched clock never boils.

> Either I needed to insert a smilie instead of <g, d & r>
> or you are the best stone-faced legpuller I've ever seen.
[quoted text clipped - 20 lines]
>>>
>>>> Threads kill themselves generally
Juan T. Llibre - 30 Oct 2005 15:59 GMT
re:
> I have been known as a cunning linguist

I thought that :

> Threads kill themselves generally
> Not the "VB.NET vs. C#" threads...

was a cunning lingual expression... ;-)

re:
> I have never seen that particular combination of symbols.

<g, d & r>  =  <grin, duck and run>

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
> You were right in the first part, Juan. Even though I have been known as a cunning
> linguist, I completely missed your play on words! Maybe I need to take a day off...
>
> I have never seen that particular combination of symbols. What does it mean, BTW?
>
> P.S. Thanks for saving me the trouble of checking out your joke!

>> Either I needed to insert a smilie instead of <g, d & r>
>> or you are the best stone-faced legpuller I've ever seen.
[quoted text clipped - 20 lines]
>>>>
>>>>> Threads kill themselves generally
Kevin Spencer - 30 Oct 2005 16:11 GMT
Muchas gracias, amigo!

Signature

Kevin Spencer
Microsoft MVP
.Net Developer
A watched clock never boils.

> re:
>> I have been known as a cunning linguist
[quoted text clipped - 48 lines]
>>>>>
>>>>>> Threads kill themselves generally

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.