Re: Threading: Stopping, restarting, etc

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




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

.



Relevant Pages

  • Re: How bout a Dukes of Hazzard pin, Steve Ritchie style!
    ... Gigantic confederate flag artwork that never in a million years would ... Of all the orders Steve has been given on RGP, I'd say I like the Star ... Now back to the pin. ... Dukes fans are still out there in droves. ...
    (rec.games.pinball)
  • Re: O_DIRECT and tcl
    ... even if Tcl supported passing that flag through (which it doesn't, ... The issue is that network systems have buffers *anyway* ... server that acts as a control point, ... Instead of reading remotley and writeing locally i've turned it the ...
    (comp.lang.tcl)
  • Re: O_DIRECT and tcl
    ... even if Tcl supported passing that flag through (which it doesn't, ... server that acts as a control point, ... Instead of reading remotley and writeing locally i've turned it the ... I'm sure sockets is a much better approch. ...
    (comp.lang.tcl)
  • Re: O_DIRECT and tcl
    ... even if Tcl supported passing that flag through (which it doesn't, ... server that acts as a control point, ... Instead of reading remotley and writeing locally i've turned it the ... Reading locally and writing remotely using "flush" so that way the ...
    (comp.lang.tcl)
  • Re: O_DIRECT and tcl
    ... There is no way that that could ever be made to work over a network, ... even if Tcl supported passing that flag through (which it doesn't, ... server that acts as a control point, ... Instead of reading remotley and writeing locally i've turned it the ...
    (comp.lang.tcl)