#include <Executor.h>
Inheritance diagram for ZThread::Executor::
Public Methods | |
virtual | ~Executor () throw () |
virtual void | execute (Runnable *task)=0 throw (Synchronization_Exception) |
virtual void | cancel ()=0 throw (Synchronization_Exception) |
virtual void | join ()=0 throw (Synchronization_Exception) |
virtual bool | available ()=0 throw (Synchronization_Exception) |
virtual unsigned int | threadCount ()=0 throw (Synchronization_Exception) |
An executor allows the efficent execution of a number of small unrelated 'Runnable' tasks, or LWP's without the over head of a large number of syncronization controls needed in a thread per task solution.
The executor itself contains heavy wieght syncrhonization controls to do this, but it will not need new ones for each additional task. This overcomes resource problems thread-per-task designs must face
In general, executors queue tasks for execution by another thread or by a pool of threads. The queueing of task allows for a good deal of control over the order of execution.
|
Destroy Executor object |
|
Block until this executor has become available to run new tasks. This does not garuntee that another thread won't have submitted a task before some action is taken in response to this. However, it is useful as a general hueristic
Reimplemented in ZThread::AbstractExecutor, ZThread::PoolExecutor, and ZThread::SyncExecutor. |
|
Stop the execution of additonal tasks by this executor. After this method has be invoked then the Executor will completed when the last task it was previously assigned is completed.
Reimplemented from ZThread::Cancelable. Reimplemented in ZThread::AbstractExecutor, and ZThread::SyncExecutor. |
|
Enqueue another task for execution.
Reimplemented in ZThread::AsyncExecutor, ZThread::PoolExecutor, and ZThread::SyncExecutor. |
|
Wait for this Executor to complete. The calling thread is blocked until the last task has been completed by this executor or until the calling thread has been interrupted.
Reimplemented in ZThread::AsyncExecutor, ZThread::PoolExecutor, and ZThread::SyncExecutor. |
|
Count of active threads operation on behalf of this executor This does not garuntee that another thread won't have submitted a task that changes the number of executing threads before some action is taken in response to this. However, it is useful as a general hueristic
Reimplemented in ZThread::AsyncExecutor, ZThread::PoolExecutor, and ZThread::SyncExecutor. |