ThreadPool is pool of re-usable threads.
Re-use of threads is beneficial as the relative heavy-weight
creation of thread can be avoided.
Constructor
Creates new thread pool.
Methods
Gets the maximum number of tasks. Sum of free, active and waiting
tasks never exceeds this number.
Gets the maximum number of threads. No more that the given
number of threads are created.
Gets the maximum number of tasks. Sum of free, active and waiting
tasks never exceeds this number.
Sets the maximum number of threads. No more that the given
number of threads are created.
Shuts down this thread pool. All threads are closed but
the pool remains usable after shutdown.
Spawns a task. Task may not be immediately executed if
all threads are currently in use.
Gets the number of threads created.
Gets the number of tasks waiting to be executed.