public static ExecutorService newWorkStealingPool (int parallelism)

Creates a thread pool that maintains enough threads to support the given parallelism level, and may use multiple queues to reduce contention. The parallelism level corresponds to the maximum number of threads actively engaged in, or available to engage in, task processing. The actual number of threads may grow and shrink dynamically. A work-stealing pool makes no guarantees about the order in which submitted tasks are executed.

Parameters:
parallelism    the targeted parallelism level

Returns:  the newly created thread pool

Exceptions:
IllegalArgumentException    if parallelism <= 0

Since:  1.8