[concurrency-interest] Whats up with the ThreadPoolExecutor?

Gregg Wonderly gergg at cox.net
Mon Aug 22 23:41:44 EDT 2005

Doug Lea wrote:
> David Holmes wrote:
>> There is an easy fix that Dawid can hopefully get into the backport in 
>> the
>> very near future:
> And the fix for the java.util.concurrent version will with some luck be 
> in Mustang.
> While we never expected anyone to reuse Runnable tasks
> in this way, (and in general, it is not a good idea)
> the specs did not say you cannot, so it is indeed a bug.

I've recently made changes to Timer to allow TimerTasks to be reused so that a TimerTask can reschedule the same object 
into the future without a lot of garbage being generated for fast cycling tasks with odd repeating intervals.  I think 
it makes a lot of sense to try and work towards reducing garbage generation by not requiring new objects.  There are, of 
course some interesting issues, such as this one...

Gregg Wonderly

More information about the Concurrency-interest mailing list