GHOST  1.1.2
General, Hybrid, and Optimized Sparse Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Classes | Functions | Variables
taskq.h File Reference

Types and functions for the task queue. More...

#include <pthread.h>
#include <hwloc.h>
#include "error.h"
#include "task.h"
Include dependency graph for taskq.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ghost_taskq
 The task queue. More...
 

Functions

ghost_error ghost_taskq_create ()
 Initializes a task queues. More...
 
ghost_error ghost_taskq_destroy ()
 Execute all outstanding threads and free the task queues' resources. More...
 
ghost_error ghost_taskq_waitall ()
 Wait for all tasks in all queues to be finished. More...
 
ghost_error ghost_taskq_waitsome (ghost_task **, int, int *)
 Wait for some tasks out of a given list of tasks. More...
 
ghost_error ghost_taskq_add (ghost_task *task)
 Helper function to add a task to a queue. More...
 
ghost_error ghost_taskq_startroutine (void *(**func)(void *))
 

Variables

ghost_taskqtaskq
 The task queue created by ghost_taskq_create(). More...
 

Detailed Description

Types and functions for the task queue.

@{

Author
Moritz Kreutzer morit.nosp@m.z.kr.nosp@m.eutze.nosp@m.r@fa.nosp@m.u.de

Function Documentation

ghost_error ghost_taskq_add ( ghost_task t)

Helper function to add a task to a queue.

Parameters
tThe task
Returns
GHOST_SUCCESS on success or GHOST_FAILURE on failure.

Here is the call graph for this function:

ghost_error ghost_taskq_create ( )

Initializes a task queues.

Returns
GHOST_SUCCESS on success or GHOST_FAILURE on failure.

Here is the call graph for this function:

ghost_error ghost_taskq_destroy ( )

Execute all outstanding threads and free the task queues' resources.

Returns
GHOST_SUCCESS on success or GHOST_FAILURE on failure.
ghost_error ghost_taskq_startroutine ( void *(**)(void *)  func)

Here is the call graph for this function:

ghost_error ghost_taskq_waitall ( )

Wait for all tasks in all queues to be finished.

Returns
GHOST_SUCCESS on success or GHOST_FAILURE on failure.

Here is the call graph for this function:

ghost_error ghost_taskq_waitsome ( ghost_task **  tasks,
int  nt,
int *  index 
)

Wait for some tasks out of a given list of tasks.

Parameters
tasksThe list of task pointers that should be waited for.
ntThe length of the list.
indexIndicating which tasks of the list are now finished.
Returns
GHOST_SUCCESS on success or GHOST_FAILURE on failure.

Variable Documentation

ghost_taskq* taskq

The task queue created by ghost_taskq_create().