This seems reasonable to me Joe.

-Chris.

> On 20 Jul 2015, at 22:15, joe darcy <[email protected]> wrote:
> 
> Hello,
> 
> Please review a small change to adders
> 
>    JDK-8081734 : ConcurrentHashMap/ConcurrentAssociateTest.java, times out 
> 90% of time on sparc with 256 cpu.
>    http://cr.openjdk.java.net/~darcy/8081734.0/
> 
> Patch below.
> 
> Some background, when run on large machines, 256 processors/threads, this 
> test takes many minutes to run due to hitting some degenerate conditions. 
> Bounding the concurrency to 32 serves the purposes of checking for the 
> conditions the test was written for while also allowing a reasonable 
> execution time for a single test.
> 
> Thanks,
> 
> -Joe
> 
> --- 
> old/test/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java 
> 2015-07-20 14:08:23.839018642 -0700
> +++ 
> new/test/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java 
> 2015-07-20 14:08:23.679018638 -0700
> @@ -120,7 +120,8 @@
>             }
>         };
> 
> -        int ps = Runtime.getRuntime().availableProcessors();
> +        // Bound concurrency to avoid degenerate performance
> +        int ps = Math.min(Runtime.getRuntime().availableProcessors(), 32);
>         Stream<CompletableFuture> runners = IntStream.range(0, ps)
>                 .mapToObj(i -> sr.get())
>                 .map(CompletableFuture::runAsync);
> 

Reply via email to