What is the low-level difference among using:
ForkJoinPool = new ForkJoinPool(X);
and
ExecutorService ex = Executors.neWorkStea
newWorkStealingPool
is a higher level of abstraction for ForkJoinPool
.
If you look at the Oracle jvm implementation, it's simply a preconfigured ForkJoinPool
:
public static ExecutorService newWorkStealingPool() {
return new ForkJoinPool(Runtime.getRuntime().availableProcessors(),
ForkJoinPool.defaultForkJoinWorkerThreadFactory,
null,
true);
}
Unfortunately looking at implementations isn't a proper way for understanding purpose of a class though.
Also credit to: https://dzone.com/articles/diving-into-java-8s-newworkstealingpools