[concurrency-interest] ThreadPoolExecutor corePoolSize incompatibility between backport and j.u.c.

Marcelo Fukushima takeshi10 at gmail.com
Sat Aug 16 10:53:26 EDT 2008


the problem is most likely due to a particular behavior on juc: it
only creates threads when the queue is full. Im not sure it needs
fixing (it suggests so) or if its already fixed in jdk7

On Sat, Aug 16, 2008 at 9:34 AM, Martin Buchholz <martinrb at google.com> wrote:
> Many bugs in ThreadPoolExecutor were fixed during late JDK6 and early JDK7.
> Can you try a recent JDK7 first and see if the problem is resolved?
>
> Martin
>
> On Sat, Aug 16, 2008 at 4:54 AM, Greg Luck <gluck at gregluck.com> wrote:
>> I am looking at moving the new version of ehcache to j.u.c, from backport,
>> as part of dropping support for Java 1.4.
>> It turns out that all my tests which test code that uses backport's
>> ThreadPoolExecutor never complete. The code which supplies the executor is
>> shown below:
>>    /**
>>      * @return Gets the executor service. This is not publically accessible.
>>      */
>>     ThreadPoolExecutor getExecutorService() {
>>         if (executorService == null) {
>>             synchronized (this) {
>>                 //0, 10, 60000, ?, Integer.MAXVALUE
>>                 executorService = new ThreadPoolExecutor(0,10,
>>                        60000, TimeUnit.MILLISECONDS, new
>> LinkedBlockingQueue());
>>             }
>>         }
>>         return executorService;
>>     }
>>
>> Without understanding exactly why, I tried changing the corePoolSize to 1.
>> This fixed the problem. My question is why? There is nothing in the JavaDoc
>> I can see which says you must use a minimum of 1.
>> And I am now worried that j.u.c. is flaky in Java 5.  Any comments from the
>> list would be much appreciated.
>>
>> Regards
>>
>> Greg Luck
>>
>> web: http://gregluck.com
>> skype: gregrluck
>> yahoo: gregrluck
>> mobile: +61 408 061 622
>>
>>
>>
>> _______________________________________________
>> Concurrency-interest mailing list
>> Concurrency-interest at cs.oswego.edu
>> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>>
>>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>



-- 
[]'s
Marcelo Takeshi Fukushima


More information about the Concurrency-interest mailing list