![]() |
Helixis 1.0
Task Programming API
|
Go to the source code of this file.
Functions | |
| void | hlx_core_add_task (hlx_task_func task, void *data) |
| void | hlx_core_add_task_in_group (hlx_task_func task, void *data, hlx_group_id group_id) |
| void | hlx_core_add_task_in_group_callback (hlx_task_func task_func, void *data, hlx_group_id group_id, hlx_group_id self_group_id, hlx_task_callback callback) |
| void | hlx_core_add_task_callback (hlx_task_func task_func, void *data, hlx_group_id self_group_id, hlx_task_callback callback) |
| void hlx_core_add_task | ( | hlx_task_func | task, |
| void * | data | ||
| ) |
Add a task in the lighter group
| task | The task to push. |
| data | User argument (optionnal). |
Definition at line 134 of file sched.c.
References hlx_core_add_task_in_group_callback(), and hlx_sheduler_find_lighter_group().
{
hlx_core_add_task_in_group_callback(task_func, data, hlx_sheduler_find_lighter_group()->id, 0, 0);
}
| void hlx_core_add_task_callback | ( | hlx_task_func | task_func, |
| void * | data, | ||
| hlx_group_id | self_group_id, | ||
| hlx_task_callback | callback | ||
| ) |
Add a task in the lighter group and call a callback when the task finished
| task | The task to push. |
| data | User argument (optionnal). |
| self_group_id | Current group id. |
| callback | The callback to call the task finished |
Definition at line 84 of file parallel_sched.c.
References hlx_core_add_task_in_group_callback(), hlx_core_add_task_in_group_callback2(), hlx_sheduler_find_lighter_group(), and hlx_group::id.
Referenced by hlx_event_notify().
{
hlx_group* best;
best = hlx_sheduler_find_lighter_group();
if (best->id == self_group_id)
{
hlx_core_add_task_in_group_callback2(task_func, data, best->id, callback);
return;
}
hlx_core_add_task_in_group_callback(task_func, data, best->id, self_group_id, callback);
}
| void hlx_core_add_task_in_group | ( | hlx_task_func | task, |
| void * | data, | ||
| hlx_group_id | group_id | ||
| ) |
Add a task in a group
| task | The task to push. |
| data | User argument (optionnal). |
| group_id | Group id where the task will be pushed. |
Definition at line 129 of file sched.c.
References hlx_core_add_task_in_group_callback().
{
hlx_core_add_task_in_group_callback(task_func, data, group_id, 0, 0);
}
| void hlx_core_add_task_in_group_callback | ( | hlx_task_func | task_func, |
| void * | data, | ||
| hlx_group_id | group_id, | ||
| hlx_group_id | self_group_id, | ||
| hlx_task_callback | callback | ||
| ) |
Add a task in a group and call a callback when the task finished
| task | The task to push. |
| data | User argument (optionnal). |
| group_id | Group id where the task will be pushed. |
| self_group_id | Current group id. |
| callback | The callback to call the task finished |
Definition at line 66 of file parallel_sched.c.
References hlx_core_add_task_in_group_callback2(), hlx_group_bufferize_task(), hlx_scheduler_init_task(), hlx_api::thread_api, and hlx_thread_api::thread_resume.
Referenced by hlx_core_add_task(), hlx_core_add_task_callback(), hlx_core_add_task_in_group(), and hlx_event_notify().
{
hlx_task* task;
hlx_group* group;
group = (hlx_group* )group_id;
if (group_id == self_group_id)
{
hlx_core_add_task_in_group_callback2(task_func, data, group_id, callback);
return ;
}
task = hlx_scheduler_init_task(task_func, data, group, callback);
if (!task)
return;
hlx_group_bufferize_task(group, task);
gl_api.thread_api.thread_resume(&(group->thread));
}
1.7.4