public class DefaultThreadPool extends java.lang.Object implements ThreadPool
It creates a wrapper for both thread pool + associated async I/O channel group service to allow execution of both compute / CPU based tasks and async I/O tasks at the same time
The thread pool that handles actual CPU bound tasks can be regular thread pool or work stealing queue pool (i.e. fork-join thread pool)
ThreadPool.ThreadPoolId| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.ExecutorService |
executorService()
Returns the executor service associated with the thread pool.
|
static ThreadPool |
getInstance(ThreadPool.ThreadPoolId threadPoolId)
See documentation for
ThreadPool.getInstance(ThreadPoolId). |
ThreadPool.ThreadPoolId |
id() |
java.nio.channels.AsynchronousChannelGroup |
ioService()
Returns the I/O service associated with the thread pool.
|
void |
shutdown()
Shuts down the thread pool.
|
public void shutdown()
ThreadPoolAfter the thread pool is shutdown any attempts to use it will throw an exception
shutdown in interface ThreadPoolpublic ThreadPool.ThreadPoolId id()
id in interface ThreadPoolpublic java.nio.channels.AsynchronousChannelGroup ioService()
ThreadPoolIf invoked on a thread pool which does not have an I/O service associated with it it will throw an exception
ioService in interface ThreadPoolpublic java.util.concurrent.ExecutorService executorService()
ThreadPoolexecutorService in interface ThreadPoolpublic static ThreadPool getInstance(ThreadPool.ThreadPoolId threadPoolId)
ThreadPool.getInstance(ThreadPoolId).getInstance in interface ThreadPoolthreadPoolId - The thread pool id of the global instance requested