Helixis 1.0
Task Programming API
Functions | Variables
sources/parallel/parallel_task_groups.c File Reference
#include "hlx/core.h"
#include "helixis_internal.h"

Go to the source code of this file.

Functions

void hlx_group_construct (hlx_group *group)
void hlx_group_destruct (hlx_group *group)
void hlx_group_flush_task_buffer (hlx_group *group)
void hlx_group_bufferize_task (hlx_group *group, hlx_task *task)
void hlx_group_add_task (hlx_group *group, hlx_task *task)
void hlx_group_del_task (hlx_group *group, hlx_task *task)
atom_t hlx_group_get_size (hlx_group *group)

Variables

hlx_api gl_api

Function Documentation

void hlx_group_add_task ( hlx_group group,
hlx_task task 
)
void hlx_group_bufferize_task ( hlx_group group,
hlx_task task 
)
void hlx_group_construct ( hlx_group group)
void hlx_group_del_task ( hlx_group group,
hlx_task task 
)
void hlx_group_destruct ( hlx_group group)

Definition at line 60 of file parallel_task_groups.c.

References _hlx_list_node::data, hlx_list::first, hlx_api::free_entry, hlx_list_clear(), _hlx_list_node::next, queue_delete(), queue_dequeue(), hlx_task::stack, hlx_group::tasks, hlx_api::thread_api, and hlx_thread_api::thread_destruct.

Referenced by hlx_scheduler_destruct().

{
        hlx_list_node* it = group->tasks.first;
        hlx_task* task;

        while (it != 0)
        {
                task = it->data;
                if (task->stack != 0)
                        gl_api.free_entry(task->stack);
                gl_api.free_entry(it->data);
                it = it->next;
        }
        hlx_list_clear(&group->tasks);
        while (queue_dequeue(group->buf_tasks, (void**)&task))
        {
                if (task->stack != 0)
                        gl_api.free_entry(task->stack);
                gl_api.free_entry(task);
        }
        queue_delete(group->buf_tasks, 0, 0);
        gl_api.thread_api.thread_destruct(&(group->thread));
}
void hlx_group_flush_task_buffer ( hlx_group group)

Definition at line 84 of file parallel_task_groups.c.

References hlx_list_push_back(), queue_dequeue(), and hlx_group::tasks.

Referenced by hlx_scheduler_schedule_group_threaded().

{
        hlx_task* task;

  task = 0;
        while (queue_dequeue(group->buf_tasks, (void**)&task))
                hlx_list_push_back(&group->tasks, task);
}
atom_t hlx_group_get_size ( hlx_group group)

Definition at line 123 of file parallel_task_groups.c.

References queue_query(), QUEUE_QUERY_ELEMENT_COUNT, hlx_list::size, and hlx_group::tasks.

Referenced by hlx_sheduler_find_lighter_group().

{
        atom_t queue_size;

        queue_query(group->buf_tasks, QUEUE_QUERY_ELEMENT_COUNT, 0, &queue_size);
        return (group->tasks.size + queue_size);
}

Variable Documentation

Definition at line 42 of file api.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines