Class DefaultThreadPoolFactory

java.lang.Object
net.algart.arrays.AbstractThreadPoolFactory
net.algart.arrays.DefaultThreadPoolFactory
All Implemented Interfaces:
ThreadPoolFactory

public class DefaultThreadPoolFactory extends AbstractThreadPoolFactory implements ThreadPoolFactory

A simple implementation of ThreadPoolFactory interface. It uses a thread pool, created by Executors.newFixedThreadPool method, and uses Arrays.SystemSettings.cpuCount() method to determine the desired number of parallel tasks, if you did not specify another number in numberOfTasks argument of the constructor or getDefaultThreadPoolFactory(int) method. See details below in comments to the methods and fields.

This class is immutable and thread-safe: there are no ways to modify settings of the created instance.

Author:
Daniel Alievsky