Java Fork/Join Pool : Is it right to assume that number of threads in fork join pool depends entirely on underlying number of CPU’s?

Tags: , ,



Can a developer tell fork/join pool to create certain number of threads?
If yes then is it guaranteed that those many number of threads will be created by pool?

Answer

Source : https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ForkJoinPool.html

A ForkJoinPool is constructed with a given target parallelism level; by default, equal to the number of available processors. The pool attempts to maintain enough active (or available) threads by dynamically adding, suspending, or resuming internal worker threads, even if some tasks are stalled waiting to join others



Source: stackoverflow