[concurrency-interest] ThreadPoolExecutorTestoccasionallyfailswith a broken barrier!?

Joe Bowbeer joe.bowbeer at gmail.com
Wed Feb 14 03:45:02 EST 2007

Maybe, every so often, it takes more than 1 second to execute the first 17

What happens if you change the barrier timeout to 2 seconds?  Do the
failures vanish?

On 2/14/07, Oliver Pfeiffer <pfeiffer at tzi.de> wrote:
> The barrier should check that a total number of 17 threads (16 + 1) are
> able
> to touch it in parallel. Thus all further threads arriving later do not
> need
> to pass the barrier.
> The occasionally thrown AssertionError comes from the broken barrier as
> checked by assertFalse(barrier.isBroken()); at the end of the test method.
> Future#get() isn't called after submission since an exception should never
> be thrown in the runnable as long as latch#countDown() is harmless. :)

But Errors can still escape.  And RuntimeExceptions and Errors can
potentially escape from execution of countDown.  Why not execute(Runnable)?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20070214/53c893bd/attachment.html 

More information about the Concurrency-interest mailing list