public class CommonPool
extends CoroutineDispatcher
Represents common pool of shared threads as coroutine dispatcher for compute-intensive tasks.
It uses java.util.concurrent.ForkJoinPool when available, which implements efficient work-stealing algorithm for its queues, so every
coroutine resumption is dispatched as a separate task even when it already executes inside the pool.
When available, it wraps ForkJoinPool.commonPool
and provides a similar shared pool where not.
Modifier and Type | Field and Description |
---|---|
static CommonPool |
INSTANCE
Represents common pool of shared threads as coroutine dispatcher for compute-intensive tasks.
It uses java.util.concurrent.ForkJoinPool when available, which implements efficient work-stealing algorithm for its queues, so every
coroutine resumption is dispatched as a separate task even when it already executes inside the pool.
When available, it wraps
ForkJoinPool.commonPool and provides a similar shared pool where not. |
Modifier and Type | Method and Description |
---|---|
void |
dispatch(kotlin.coroutines.experimental.CoroutineContext context,
java.lang.Runnable block)
Dispatches execution of a runnable block onto another thread in the given context.
|
java.lang.String |
toString() |
dispatch, interceptContinuation, isDispatchNeeded, toString
public static CommonPool INSTANCE
Represents common pool of shared threads as coroutine dispatcher for compute-intensive tasks.
It uses java.util.concurrent.ForkJoinPool when available, which implements efficient work-stealing algorithm for its queues, so every
coroutine resumption is dispatched as a separate task even when it already executes inside the pool.
When available, it wraps ForkJoinPool.commonPool
and provides a similar shared pool where not.