|
AndroMeta
2.0.0
|
Manages thread pooling and queueing to support a group of MProc's running a specific task. More...
#include <MProcTask.h>
Public Member Functions | |
| MProcTask (size_t threads) | |
| MProcTask (size_t startThreads, size_t maxThreads, long queueMax=-1) | |
| ~MProcTask () | |
| void | run () |
| void | run (const mtime &timeout) |
| size_t | currentThreads () const |
| void | halt (bool clear=false) |
| void | resume () |
| void | reset () |
| void | setMinPriority (double priority) |
| void | clearMinPriority () |
| void | await () |
| bool | await (const mtime &timeout) |
Friends | |
| class | MProcTask_ |
Manages thread pooling and queueing to support a group of MProc's running a specific task.
| Meta::MProcTask::MProcTask | ( | size_t | threads | ) |
Constructor.
| threads | The initial and maximum number of threads this task shall use. |
| Meta::MProcTask::MProcTask | ( | size_t | startThreads, |
| size_t | maxThreads, | ||
| long | queueMax = -1 |
||
| ) |
Constructor.
| startThreads | The initial number of threads this task uses. |
| maxThreads | The maximum number of threads this task shall grow to as dynamically needed. |
| queueMax | The maximum number of MProc's that may be queued simultaneously or -1 for no limit. When the limit is reached, items at the end of the priority queue are deleted. |
Destructor. Cleanly shuts down the task.
| void Meta::MProcTask::await | ( | ) |
Blocking call that waits for all queued MProc's in this task to finish running.
| bool Meta::MProcTask::await | ( | const mtime & | timeout | ) |
Semi-blocking call that waits for all queued MProc's in this task to finish running, or for timeout to be reached.
| void Meta::MProcTask::clearMinPriority | ( | ) |
Clear the minimum priority that was set by setMinPriority().
| size_t Meta::MProcTask::currentThreads | ( | ) | const |
| void Meta::MProcTask::halt | ( | bool | clear = false | ) |
Stop execution of the task.
| clear | If true, clear all queued MProc's. |
| void Meta::MProcTask::reset | ( | ) |
Halt, clear, and resume the task.
| void Meta::MProcTask::resume | ( | ) |
Resume execution of a halted task.
| void Meta::MProcTask::run | ( | ) |
Blocking call to run this task from the main thread.
| void Meta::MProcTask::run | ( | const mtime & | timeout | ) |
Semi-blocking call to run the task from the main thread for a specified period of time.
| void Meta::MProcTask::setMinPriority | ( | double | priority | ) |
Set the minimum priority of queued MProc's this task shall process.
1.7.6.1