RFR for JDK-8025198 Intermittent test failure: java/util/concurrent/ThreadPoolExecutor/ThrowingTasks.java

Martin Buchholz martinrb at google.com
Fri Nov 1 19:59:44 UTC 2013


Hi Tristan,

I'm having unexpected trouble discovering the author's intent in some of
this code... :-(

It would be useful if you posted your changes in the form of a diff (diff
-u) or a webrev.

What do you mean "the BlockingQueue is full"?  Isn't it unbounded?

(Tristan is also my son's name!)



On Fri, Nov 1, 2013 at 7:17 AM, Tristan Yan <tristan.yan at oracle.com> wrote:

> /Hi Everyone
>
> /
>
> /I am working on bug https://bugs.openjdk.java.net/browse/JDK-8025198.
> Root cause for this bug is //there is a race condition on below code.
> //there is a very small chance that when 11th thread finishes
> allStarted.countDown() and before check the count, 10th thread does
> countDown, then 2nd to 11th threads go into wait allStarted and last thread
> can't get the execution because the BlockingQueue is full. /
>
> /            allStarted.countDown(); //
> //            if (allStarted.getCount() < getCorePoolSize()) //
> /
>
> /I am going to fixed above code as below//
> //            lock.lock();//
> //            boolean lessThanCorePoolSize = false;//
> //            try{//
> //                allStarted.countDown();//
> //                lessThanCorePoolSize = allStarted.getCount() <
> getCorePoolSize();//
> //            } finally {//
> //                lock.unlock();//
> //            }//
> //            if (lessThanCorePoolSize) //
> ///
>
> //
>
> /Please let me know if you have any comments or suggestions.//
> //
> //Tristan//
> /
>



More information about the core-libs-dev mailing list