Lightweight Parallel Foundations 1.0.1-alpha 2023-06-26T11:02:34Z
A high performance and model-compliant communication layer
Functions
Specific to Pthreads
Collaboration diagram for Specific to Pthreads:

Functions

lpf_err_t lpf_pthread_initialize (lpf_pid_t pid, lpf_pid_t nprocs, lpf_init_t *init)
 
lpf_err_t lpf_pthread_finalize (lpf_init_t init)
 

Detailed Description

Function Documentation

◆ lpf_pthread_initialize()

lpf_err_t lpf_pthread_initialize ( lpf_pid_t  pid,
lpf_pid_t  nprocs,
lpf_init_t init 
)

When called from within a multi-threaded program, it initialises the lpf_init_t object for use with lpf_hook(). All threads that are supposed to join in the lpf_hook() are required to call this function collectively with a private memory location for init . An obvious use for this function is to allow existing multi-threaded applications to use LPF codes.

Parameters
[in]pidThe same id that this thread will get when lpf_hook() is called.
[in]nprocsThe number of threads that call this function and the subsequent call to lpf_hook().
[out]initThe lpf_init_t init object that can be used through lpf_hook(). The memory location for this variable can but is not required to be shared between threads.
Returns
LPF_SUCCESS at successful initialization.
LPF_ERR_OUT_OF_MEMORY when there wasn't enough memory.
LPF_ERR_FATAL when the system encountered an unrecoverable error.

◆ lpf_pthread_finalize()

lpf_err_t lpf_pthread_finalize ( lpf_init_t  init)