#include <ws_scheduler.h>
Public Member Functions | |
ws_scheduler (int threadNum) | |
virtual | ~ws_scheduler () |
void | shutdown () |
put a shutdown signal into the working queues. | |
void | addTask (TaskType *task) |
void | addTask (int index, TaskType *task) |
TaskType * | getTask (int threadId) |
Node: It won't delete any memory space allocated by caller.
TaskType | type of the tasks to be scheduled |
amino::ws_scheduler< TaskType >::ws_scheduler | ( | int | threadNum | ) | [inline] |
virtual amino::ws_scheduler< TaskType >::~ws_scheduler | ( | ) | [inline, virtual] |
void amino::ws_scheduler< TaskType >::shutdown | ( | ) | [inline] |
void amino::ws_scheduler< TaskType >::addTask | ( | TaskType * | task | ) | [inline] |
Add a task into the interal work queues. The task will be added to a rand queue.
task | inserting task |
void amino::ws_scheduler< TaskType >::addTask | ( | int | index, | |
TaskType * | task | |||
) | [inline] |
Add a task into the interal work queues. The task will be added to the queue which specified by function parameter.
index | index of the queue which will be used to store the task | |
task | inserting task |
TaskType* amino::ws_scheduler< TaskType >::getTask | ( | int | threadId | ) | [inline] |
Get a task from internal queues. The queue with an index of threadId
will be checked at first. This method will block if current queue is empty and it fails to steal.
threadId | id of requesting thread |