Re: reuse a thread which is no longer "alive"
From: Kai Grossjohann (kgrossjo_at_eu.uu.net)
Date: 02/26/04
- Next message: Ola Gustafsson: "Re: Wildcards in <url-pattern>"
- Previous message: Tom N: "Re: Ethernet ID and system Info in Java"
- In reply to: sayoyo: "reuse a thread which is no longer "alive""
- Next in thread: sayoyo: "Re: reuse a thread which is no longer "alive""
- Reply: sayoyo: "Re: reuse a thread which is no longer "alive""
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 26 Feb 2004 09:38:21 +0100
"sayoyo" <dontwantspam@yahoo.com> writes:
> 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.
There is a util-concurrent Java package which provides a thread pool
class. You hand a runnable to the thread pool, and it will look for
an unoccupied thread to execute that runnable. When the runnable is
done, the thread becomes available again.
Google for "util-concurrent".
Kai
- Next message: Ola Gustafsson: "Re: Wildcards in <url-pattern>"
- Previous message: Tom N: "Re: Ethernet ID and system Info in Java"
- In reply to: sayoyo: "reuse a thread which is no longer "alive""
- Next in thread: sayoyo: "Re: reuse a thread which is no longer "alive""
- Reply: sayoyo: "Re: reuse a thread which is no longer "alive""
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|