commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David J. M. Karlsen" <da...@davidkarlsen.com>
Subject Question on Threadpool
Date Wed, 19 Nov 2003 02:09:38 GMT
Hi!

I use DefaultThreadpool to dispatch work to in a standalone java-app. 
The problem is that the application never terminates, even  after all my 
worker threads I added to Threadpool terminate (exit their run() methods).

Why doesn't threadpool stop to run() when it's queue is empty?

Also I do not understand the DefaultThreadPool(int size) constructor:
it calls startThread size times. startThread then does:


   Thread thread = new Thread( this );
         thread.start();
         return thread;

so the DefaultThreadPool replaces it's Thread object size times - what's 
the point in that?

what am I missing out on?



-- 
David J. M. Karlsen - +47 90 68 22 43
http://www.davidkarlsen.com
http://mp3.davidkarlsen.com


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message