ExecutorService but it uses CLTasks
instead of Callables and provides a per-queue context for resource sharing across all tasks of one queue.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | CLCommandQueuePool.
The action executed after a task completes. |
| private static class | |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private List | |
| private ExecutorService | |
| private CLCommandQueuePool. | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static <C extends CLQueueContext> CLCommandQueuePool | create(final CLQueueContextFactory<C> factory, final CLMultiContext mc, final CLCommandQueue.
|
| public static <C extends CLQueueContext> CLCommandQueuePool | create(final CLQueueContextFactory<C> factory, final Collection<CLDevice> devices, final CLCommandQueue.
|
| public static <C extends CLQueueContext> CLCommandQueuePool | |
| public void | |
| public void | |
| public CLCommandQueuePool. | |
| public List | |
| public int | |
| private List | |
| private void | |
| public <R> List | invokeAll(final Collection<? extends CLTask<? super C, R>> tasks)
Submits all tasks to the pool for immediate execution (blocking) and returns their |
| public <R> List | invokeAll(final Collection<? extends CLTask<? super C, R>> tasks, final long timeout, final TimeUnit unit)
Submits all tasks to the pool for immediate execution (blocking) and returns their |
| public boolean | isReleased()
Implements com. release() has been called.
|
| public void | |
| public void | setFinishAction(final CLCommandQueuePool.
Sets the action which is run after every completed task. |
| public <R> Future | |
| public <R> List | submitAll(final Collection<? extends CLTask<? super C, R>> tasks)
Submits all tasks to the pool for execution and returns their |
| public CLCommandQueuePool | Returns: thisSwitches the context of all queues - this operation can be expensive. |
| public String | |
| private <R> List |
| contexts | back to summary |
|---|---|
| private List<CLQueueContext> contexts | |
| excecutor | back to summary |
|---|---|
| private ExecutorService excecutor | |
| finishAction | back to summary |
|---|---|
| private CLCommandQueuePool. | |
| released | back to summary |
|---|---|
| private boolean released | |
| CLCommandQueuePool | back to summary |
|---|---|
| private CLCommandQueuePool(final CLQueueContextFactory<C> factory, final Collection<CLCommandQueue> queues) | |
| create | back to summary |
|---|---|
| public static <C extends CLQueueContext> CLCommandQueuePool | |
| create | back to summary |
|---|---|
| public static <C extends CLQueueContext> CLCommandQueuePool | |
| create | back to summary |
|---|---|
| public static <C extends CLQueueContext> CLCommandQueuePool | |
| finishQueues | back to summary |
|---|---|
| public void finishQueues() Calls | |
| flushQueues | back to summary |
|---|---|
| public void flushQueues() Calls | |
| getFinishAction | back to summary |
|---|---|
| public CLCommandQueuePool. | |
| getQueues | back to summary |
|---|---|
| public List Returns the command queues used in this pool. | |
| getSize | back to summary |
|---|---|
| public int getSize() Returns the size of this pool (number of command queues). | |
| initContexts | back to summary |
|---|---|
| private List | |
| initExecutor | back to summary |
|---|---|
| private void initExecutor() | |
| invokeAll | back to summary |
|---|---|
| public <R> List Submits all tasks to the pool for immediate execution (blocking) and returns their | |
| invokeAll | back to summary |
|---|---|
| public <R> List Submits all tasks to the pool for immediate execution (blocking) and returns their | |
| isReleased | back to summary |
|---|---|
| public boolean isReleased() Implements com. Doc from com. Returns true if
| |
| release | back to summary |
|---|---|
| public void release() Implements com. Releases all queues.
| |
| setFinishAction | back to summary |
|---|---|
| public void setFinishAction(final CLCommandQueuePool. Sets the action which is run after every completed task.
This is mainly intended for debugging, default value is | |
| submit | back to summary |
|---|---|
| public <R> Future Submits this task to the pool for execution returning its | |
| submitAll | back to summary |
|---|---|
| public <R> List Submits all tasks to the pool for execution and returns their | |
| switchContext | back to summary |
|---|---|
| public CLCommandQueuePool Switches the context of all queues - this operation can be expensive. Blocks until all tasks finish and sets up a new context for all queues.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| wrapTasks | back to summary |
|---|---|
| private <R> List | |
| Modifier and Type | Field and Description |
|---|---|
| public static final CLCommandQueuePool. | DO_NOTHING
Does nothing, the task is responsible to make sure all computations have finished when the task finishes |
| public static final CLCommandQueuePool. | FINISH
Finishes the queue on task completion. |
| public static final CLCommandQueuePool. | FLUSH
Flushes the queue on task completion. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static CLCommandQueuePool. | |
| public static CLCommandQueuePool. |
| DO_NOTHING | back to summary |
|---|---|
| public static final CLCommandQueuePool. Does nothing, the task is responsible to make sure all computations have finished when the task finishes | |
| FINISH | back to summary |
|---|---|
| public static final CLCommandQueuePool. Finishes the queue on task completion. | |
| FLUSH | back to summary |
|---|---|
| public static final CLCommandQueuePool. Flushes the queue on task completion. | |
| FinishAction | back to summary |
|---|---|
| private FinishAction() | |
| valueOf | back to summary |
|---|---|
| public static CLCommandQueuePool. | |
| values | back to summary |
|---|---|
| public static CLCommandQueuePool. | |
| Modifier and Type | Field and Description |
|---|---|
| private final CLQueueContext |
| Access | Constructor and Description |
|---|---|
| public | QueueThread(final ThreadGroup group, final Runnable runnable, final CLQueueContext context, final int index)
|
| context | back to summary |
|---|---|
| private final CLQueueContext context | |
| QueueThread | back to summary |
|---|---|
| public QueueThread(final ThreadGroup group, final Runnable runnable, final CLQueueContext context, final int index) | |
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized Thread | newThread(final Runnable
a runnable to be executed by new thread instance runnable)Implements java. Thread to run the given runnable.
|
| context | back to summary |
|---|---|
| private final List<CLQueueContext> context | |
| index | back to summary |
|---|---|
| private int index | |
| QueueThreadFactory | back to summary |
|---|---|
| private QueueThreadFactory(final List<CLQueueContext> queues) | |
| newThread | back to summary |
|---|---|
| public synchronized Thread newThread(final Runnable runnable) Implements java. Doc from java. Constructs a new unstarted | |
| Modifier and Type | Field and Description |
|---|---|
| private final CLCommandQueuePool. | |
| private final CLTask |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public R | call()
Implements java. |
| mode | back to summary |
|---|---|
| private final CLCommandQueuePool. | |
| task | back to summary |
|---|---|
| private final CLTask<? super C, R> task | |
| TaskWrapper | back to summary |
|---|---|
| public TaskWrapper(final CLTask<? super C, R> task, final CLCommandQueuePool. | |
| call | back to summary |
|---|---|
| public R call() throws Exception Implements java. Doc from java. Computes a result, or throws an exception if unable to do so.
| |