From: Gustavo Martin Morcuende Date: Thu, 8 Dec 2016 00:36:38 +0000 (+0100) Subject: NOTICE about parallelism and ForkJoinPool X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=998fde0b4c1e6f6beef9999772bd5d24125f207b;p=JavaForFun NOTICE about parallelism and ForkJoinPool --- diff --git a/Allgemeines/Threads/ForkJoin/src/de/test/fork/join/ForkJoinTaskExample.java b/Allgemeines/Threads/ForkJoin/src/de/test/fork/join/ForkJoinTaskExample.java index 9932c42..6416fe7 100644 --- a/Allgemeines/Threads/ForkJoin/src/de/test/fork/join/ForkJoinTaskExample.java +++ b/Allgemeines/Threads/ForkJoin/src/de/test/fork/join/ForkJoinTaskExample.java @@ -36,6 +36,13 @@ public class ForkJoinTaskExample { // java.util.concurrent.ForkJoinPool.common.threadFactory - the class name of a ForkJoinPool.ForkJoinWorkerThreadFactory // java.util.concurrent.ForkJoinPool.common.exceptionHandler - the class name of a Thread.UncaughtExceptionHandler + + // ForkJoinPool.makeCommonPool() tiene la lógica para calcular el parallelism. El parallelism indica el número de hilos + // en el pool del ForkJoinPool común (compartido en una misma JVM) + // Viene dado o por la propiedad del sistema java.util.concurrent.ForkJoinPool.common.parallelism + // o por el número de CPUs que tenemos Runtime.getRuntime().availableProcessors() + + // By default there is no value for java.util.concurrent.ForkJoinPool.common.exceptionHandler // SO BY DEFAULT, UNCAUGHT EXCEPTIONS ARE LOST FOREVER!!!! :/ final ForkJoinPool pool = new ForkJoinPool();