Re: How to restart a thread in Java



Does legal mean the code won't compile or that it just isn't good
practice? I ask because I have a class that contains a run() for a thread
and I call it everytime I need to do the operation that the run() performs
and I do so w/o creating a new instant of the class that the run() is a
part of. So far I haven't seen any problems with that approach. Is that
not the same thing as what the original poster was trying to do?

Legal in the sense that it won't work. If you create a new thread and start
it, when it finishes running whatever top level run() method you give it,
and that run() method returns, that thread is finished and it will not
restart, no matter what you do. You will have to create a new one. You can
create new threads all day long, and give them the same old run() method the
same old instance, that works just fine. But the thread dies when run()
returns, and it cannot be revived.


.



Relevant Pages

  • Bernadette acknowledges north-east
    ... inserts with respect to their practice. ... No inevitable institutions are ... A lot of convinced charming pets will ... Almost no contrasts once matter the ...
    (sci.crypt)
  • Simon might nervously take our knee
    ... Otherwise the tale in Mohammar's practice might govern some cultural ... assessing the arena's jittery tap and Larry will recognize you! ... Darin, within broadcastings raw and arab, calculates no matter how it, ... Why Aziz's injured sum shares, ...
    (sci.crypt)
  • Re: Finding subtext (was Re: Does your reading corrupt your writing?)
    ... more problems with your oral communications, as well as your written ones. ... I suspect it's more a matter of training and practice and probably some ... such a kind of restricted medium - and books even lack smileys! ...
    (rec.arts.sf.composition)
  • Re: Finding subtext (was Re: Does your reading corrupt your writing?)
    ... more problems with your oral communications, as well as your written ones. ... I suspect it's more a matter of training and practice and probably some ... I have found that it is also a *reading* problem. ...
    (rec.arts.sf.composition)
  • Re: The muscle repeatability limit
    ... If you're hitting a substantial percentage of chips fat/thin, then I suspect it's either inconsistant setup, or some extra body movement during the swing, or you're not focused on hitting the ball solid. ... uncertainty and doubt creeps in there and I start thinking about how hard I need to swing or where the ball is going rather than staying focused on contact and simply repeating my practice stroke. ... Of course the other side of this is that you're absolutely right, in the sense that no one can perfectly repeat their swing, and golf is about minimizing the mistakes and recovering from them. ... It's not a matter of not knowing what to do or not being familiar enough with the motion, I've just reached the limit with which my muscles will repeat the same motions. ...
    (rec.sport.golf)