Generic Lightweight Thread (GLT) Library  2.5
A common API for Lightweight Thread solutions
 All Functions Variables Groups Pages
Functions
Work-units functions

Functions

GLT_ultglt_ult_malloc (int number_of_ult)
 ULT allocation. More...
 
GLT_taskletglt_tasklet_malloc (int number_of_tasklets)
 ULT allocation. More...
 
void glt_ult_create (void(*thread_func)(void *), void *arg, GLT_ult *new_ult)
 ULT creation. More...
 
void glt_ult_create_to (void(*thread_func)(void *), void *arg, GLT_ult *new_ult, int dest)
 ULT creation in a given destination. More...
 
void glt_tasklet_create (void(*thread_func)(void *), void *arg, GLT_tasklet *new_ult)
 Tasklet creation. More...
 
void glt_tasklet_create_to (void(*thread_func)(void *), void *arg, GLT_tasklet *new_ult, int dest)
 Tasklet creation. More...
 
void glt_yield ()
 ULT yields to another ready ULT. More...
 
void glt_yield_to (GLT_ult ult)
 ULT yields to an specific ULT. More...
 
void glt_ult_join (GLT_ult *ult)
 Joins an specific ULT. More...
 
void glt_tasklet_join (GLT_tasklet *tasklet)
 Joins an specific Tasklet. More...
 
void glt_ult_get_id (GLT_ult_id *id, GLT_ult ult)
 Return the unique id of a ULT. More...
 
void glt_workunit_get_thread_id (GLT_thread_id *id)
 Return the unique id of a thread. More...
 
void glt_ult_migrate_self_to (GLT_thread_id id)
 Migrates the current ULT to another thread ready queue. More...
 
void glt_ult_self (GLT_ult *ult)
 Obtains the current ULT handle. More...
 
void glt_tasklet_self (GLT_tasklet *tasklet)
 Obtains the current Tasklet handle. More...
 
void glt_ult_cancel (GLT_ult ult)
 Cancels an specific ULT. More...
 
void glt_tasklet_cancel (GLT_tasklet tasklet)
 Cancels an specific Tasklet. More...
 
void glt_ult_exit ()
 Exits the current ULT. More...
 

Detailed Description

These functions create, map, schedule, join, and execute work-units.

Function Documentation

void glt_tasklet_cancel ( GLT_tasklet  tasklet)

Cancels an specific Tasklet.

glt_tasklet_cancel() cancels a given GLT_tasklet.

Parameters
[in]taskletHandle to the target GLT_tasklet.
void glt_tasklet_create ( void(*)(void *)  thread_func,
void *  arg,
GLT_tasklet new_ult 
)

Tasklet creation.

glt_tasklet_create() creates a GLT_tasklet.

Parameters
[in]thread_funcIs the function pointer to be executed by the GLT_tasklet.
[in]argAre the arguments for thread_func.
[out]new_ultHandle to a newly created GLT_tasklet.
void glt_tasklet_create_to ( void(*)(void *)  thread_func,
void *  arg,
GLT_tasklet new_ult,
int  dest 
)

Tasklet creation.

glt_tasklet_create() creates a GLT_tasklet.

Parameters
[in]thread_funcIs the function pointer to be executed by the GLT_tasklet.
[in]argAre the arguments for thread_func.
[out]new_ultHandle to a newly created GLT_tasklet.
[in]destNumber of the GLT_thread that should execute the newly created GLT_tasklet.
void glt_tasklet_join ( GLT_tasklet tasklet)

Joins an specific Tasklet.

glt_tasklet_join() joins a given GLT_tasklet.

Parameters
[in]taskletHandle to the target GLT_tasklet.
GLT_tasklet* glt_tasklet_malloc ( int  number_of_tasklets)

ULT allocation.

glt_tasklet_malloc() allocates memory for a given number of GLT_tasklet.

Parameters
[in]number_of_taskletsIndicates the total number of GLT_tasklets that needs to be allocated.
Returns
The pointer to the allocated memory.
void glt_tasklet_self ( GLT_tasklet tasklet)

Obtains the current Tasklet handle.

glt_tasklet_self() returns the current GLT_tasklet handler.

Parameters
[out]taskletHandler of the the current GLT_tasklet.
void glt_ult_cancel ( GLT_ult  ult)

Cancels an specific ULT.

glt_ult_cancel() cancels a given GLT_ult.

Parameters
[in]ultHandle to the target GLT_ult.
void glt_ult_create ( void(*)(void *)  thread_func,
void *  arg,
GLT_ult new_ult 
)

ULT creation.

glt_ult_create() creates a GLT_ult.

Parameters
[in]thread_funcIs the function pointer to be executed by the GLT_ult.
[in]argAre the arguments for thread_func.
[out]new_ultHandle to a newly created GLT_ult.
void glt_ult_create_to ( void(*)(void *)  thread_func,
void *  arg,
GLT_ult new_ult,
int  dest 
)

ULT creation in a given destination.

glt_ult_create_to() creates a GLT_ult in a particular destination.

Parameters
[in]thread_funcIs the function pointer to be executed by the GLT_ult.
[in]argAre the arguments for thread_func.
[out]new_ultHandle to a newly created GLT_ult.
[in]destNumber of the GLT_thread that should execute the newly created GLT_ult.
void glt_ult_exit ( )

Exits the current ULT.

glt_ult_exit() cancels the current GLT_ult.

void glt_ult_get_id ( GLT_ult_id id,
GLT_ult  ult 
)

Return the unique id of a ULT.

glt_ult_get_id() returns the id of a given GLT_ult.

Parameters
[in]ultHandle to the target GLT_ult.
[out]idIdentifier if the the target GLT_ult.
void glt_ult_join ( GLT_ult ult)

Joins an specific ULT.

glt_ult_join() joins a given GLT_ult.

Parameters
[in]ultHandle to the target GLT_ult.
GLT_ult* glt_ult_malloc ( int  number_of_ult)

ULT allocation.

glt_ult_malloc() allocates memory for a given number of GLT_ult.

Parameters
[in]number_of_ultIndicates the total number of GLT_ult that needs to be allocated.
Returns
The pointer to the allocated memory.
void glt_ult_migrate_self_to ( GLT_thread_id  id)

Migrates the current ULT to another thread ready queue.

glt_ult_migrate_self_to() moves the current GLT_ult to another GLT_thread ready queue.

Parameters
[in]Theidentifier of the the GLT_thread destination.
void glt_ult_self ( GLT_ult ult)

Obtains the current ULT handle.

glt_ult_self() returns the current GLT_ult handler.

Parameters
[out]ultHandler of the the current GLT_ult.
void glt_workunit_get_thread_id ( GLT_thread_id id)

Return the unique id of a thread.

glt_workunit_get_thread_id() returns the id of the current GLT_thread.

Parameters
[out]idIdentifier of the the current GLT_thread.
void glt_yield ( )

ULT yields to another ready ULT.

glt_yield() puts the current GLT_ult in the ready queue and allows another ready GLT_ult to be executed.

void glt_yield_to ( GLT_ult  ult)

ULT yields to an specific ULT.

glt_yield_to() puts the current GLT_ult in the ready queue and allows an specific ready GLT_ult to be executed.

Parameters
[in]ultHandle to the target GLT_ult.