Re: Threading: Stopping, restarting, etc
- From: "Larry Lard" <larrylard@xxxxxxxxxxx>
- Date: 2 May 2006 08:23:23 -0700
Steve wrote:
Hi Nicholas,
I agree that I should not create the thread in the ctor, I changed that
after reading your post. I also understand what you mean about the stop
flag being checked, it's like Jon Skeet's article that Larry posted.
My situation is maybe a bit unique in that my thread is stuck in a method
call that can't check for the stop flag. I would like to kill the thread
gracefully, but I'm not sure if I can.
Ah, so while waiting you are actually in third party code with no
timeout or way to neatly interrupt? Hmm. Well in that case, maybe hook
to ThreadInterruptedException, and do a Thread.Interrupt when you want
to signal the thread. As I understand it, Thread.Interrupt is much less
rude than Thread.Abort.
--
Larry Lard
Replies to group please
.
- References:
- Threading: Stopping, restarting, etc
- From: Steve
- Re: Threading: Stopping, restarting, etc
- From: Nicholas Paldino [.NET/C# MVP]
- Re: Threading: Stopping, restarting, etc
- From: Steve
- Threading: Stopping, restarting, etc
- Prev by Date: Re: C# fixed array in structure
- Next by Date: Getting MS Outlook Public Folder
- Previous by thread: Re: Threading: Stopping, restarting, etc
- Next by thread: Re: Threading: Stopping, restarting, etc
- Index(es):
Relevant Pages
|