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?


Source :

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