#include <queue.h>

Public Member Functions | |
| exepool (int alloc_size, long granularity=5, int time_sample_alloc_size=100) | |
| virtual | ~exepool () |
| Destroy the pool. | |
| void | cleanupLater (exeque *q) |
| Add a queue to the auto-cleanup list. | |
| void | cleanupAutoDeletes (bool force) |
| Make sure the auto-deleted pools are cleaned up and stopped. | |
| void | setLogger (const log &logger) |
| Set the logger object. | |
| void | stop (bool block=false) |
| bool | isStopped (long wait_usec=0) const |
| int | getImminentCount (unsigned usecs=0) const |
| Get the number of pebbles that are scheduled and imminent to run. | |
| void | add (pebble *p) |
| void | add (const struct timespec &ts, pebble *p) |
| void | add (int after_seconds, pebble *p) |
| const poolstats & | getStats (poolstats &ps, bool reset=false) const |
| int | getSize () const |
Protected Attributes | |
| long | granularity |
| int | time_sample_alloc_size |
| int | alloc_size |
| int | size |
| exeque * | feed |
| exeque ** | qs |
| log | logger |
| karoo_mutex | auto_sem |
| list< exeque * > | auto_scheduled |
| list< exeque * > | auto_stopped |
Friends | |
| class | poolpebble |
You can add as many pebbles (task objects) to the exeque as you like, and they will be executed pretty much in the order you added them, though not strictly synchronously. You can also add then with a timestamp set in the future. Then they will be executed after that date.
| virtual karoo::exepool::~exepool | ( | ) | [virtual] |
Destroy the pool.
Note that it is very important to call exepool::stop(true) before destroying the queue, to avoid race conditions.
| void karoo::exepool::cleanupAutoDeletes | ( | bool | force | ) |
Make sure the auto-deleted pools are cleaned up and stopped.
This method blocks until it has completed this cleanup.
| void karoo::exepool::cleanupLater | ( | exeque * | q | ) |
Add a queue to the auto-cleanup list.
The queue will be deleted at a later date.
| int karoo::exepool::getImminentCount | ( | unsigned | usecs = 0 |
) | const |
Get the number of pebbles that are scheduled and imminent to run.
| usecs | the number of microseconds (of waiting pebbles) to consider as "imminent" |
| void karoo::exepool::setLogger | ( | const log & | logger | ) |
Set the logger object.
| logger | the log object for sending warninfs, errors etc... to |
1.5.8