Helixis 1.0
Task Programming API
Functions
includes/hlx/sched.h File Reference

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)

Function Documentation

void hlx_core_add_task ( hlx_task_func  task,
void *  data 
)

Add a task in the lighter group

Parameters:
taskThe task to push.
dataUser argument (optionnal).
See also:
hlx_core_add_task_in_group()

Definition at line 134 of file sched.c.

References hlx_core_add_task_in_group_callback(), and hlx_sheduler_find_lighter_group().

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

Parameters:
taskThe task to push.
dataUser argument (optionnal).
self_group_idCurrent group id.
callbackThe callback to call the task finished
See also:
hlx_core_add_task()

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

Parameters:
taskThe task to push.
dataUser argument (optionnal).
group_idGroup id where the task will be pushed.
See also:
hlx_core_create_group()
hlx_core_add_task()

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

Parameters:
taskThe task to push.
dataUser argument (optionnal).
group_idGroup id where the task will be pushed.
self_group_idCurrent group id.
callbackThe callback to call the task finished
See also:
hlx_core_create_group()
hlx_core_add_task_in_group()

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));
}
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines