Re: reuse a thread which is no longer "alive"

From: Jeff Rhines (jrhines_at_despammed.com)
Date: 02/25/04


Date: Wed, 25 Feb 2004 22:47:40 GMT

What i've done in the past is use a queue that i fill with runnables, and
have dequeue threads that wait for something to be in the queue. When there
is a runnable in the queue, one of the threads grabs it and executes it,
then goes back to trying to dequeue something out of the queue. Cool, eh?
Let me know if you need more implementation details.

Jeff

"sayoyo" <dontwantspam@yahoo.com> wrote in message
news:Uz3%b.11378$253.909039@news20.bellglobal.com...
> Hi,
>
> Is there some way that we can reuse a thread by replacing the runnable
> object of the thread? like a thread is not "alive" anymore, then we remove
> the runnable object(is it possible????) and then run it again.
>
> Thanks you very much
>
> Sayoyo
>
>



Relevant Pages

  • Re: reuse a thread which is no longer "alive"
    ... Sayoyo ... > What i've done in the past is use a queue that i fill with runnables, ... > have dequeue threads that wait for something to be in the queue. ...
    (comp.lang.java)
  • Re: reuse a thread which is no longer "alive"
    ... Ok, i'm making a unit-tested component to do this, for fun. ... >> What i've done in the past is use a queue that i fill with runnables, ... >> have dequeue threads that wait for something to be in the queue. ...
    (comp.lang.java)