#include <Processor.h>
Processor implement a thread pool to execute actions
- Todo:
- add a start method bool start(int nb_max_thread = 0, int nb_min_thread) and manage an inactive state and a min thread pool size.
commore::Processor::Processor |
( |
const char * |
name, |
|
|
const int |
nb_max_thread, |
|
|
int |
min_thread |
|
) |
| |
- Parameters
-
nb_max_thread | maximal number of thread of the processor. 0 means it will have no limit. |
min_trhead | number min of thread in processor |
- Todo:
- add a minimal parameter and a constructor for inactve processor Processor(bool active)
void commore::Processor::abort |
( |
| ) |
|
Send an abort request to all actions and empties the waiting action list
const AString& commore::Processor::get_name |
( |
| ) |
const |
- Returns
- name of processor this is useful only for debug purpose
void commore::Processor::pause |
( |
| ) |
|
Pause the processor wich will no longer run new actions, running action will continue normally
void commore::Processor::remove_from_submitted_action |
( |
const PAction & |
action | ) |
|
Unsubmit an action (before it was executed)
- Parameters
-
void commore::Processor::resume |
( |
| ) |
|
bool commore::Processor::start |
( |
const char * |
name, |
|
|
int |
min_thread = 0 , |
|
|
int |
max_thread = 64 |
|
) |
| |
Start processor
- Parameters
-
max_thread | number max of thread in processor |
min_trhead | number min of thread in processor |
- Returns
- true if processor is started
bool commore::Processor::stop |
( |
| ) |
|
Send a stop request to all actions and empties the waiting action list
bool commore::Processor::submit |
( |
const PAction & |
action | ) |
|
bool commore::Processor::submit |
( |
ActionGroup & |
actions | ) |
|
Submit a group of action to a processor
- Parameters
-
- Todo:
- use void submit(const ActionGroup& actions);
bool commore::Processor::submit |
( |
ProcessFunction |
f, |
|
|
void * |
p |
|
) |
| |
Submit a function
- Parameters
-
f | function to execute |
p | function argument |
void commore::Processor::terminate |
( |
| ) |
|
Free the processor's thread
bool commore::Processor::waitAction |
( |
const PAction & |
action, |
|
|
const int |
nTimeOut_ms = 0 |
|
) |
| |
void commore::Processor::waitIdle |
( |
| ) |
|
The documentation for this class was generated from the following file: