Function Evaluator

Function Evaluator — A general purpose multi-threaded function evaluator

Synopsis

void                (*NcmLoopFunc)                      (glong i,
                                                         glong f,
                                                         gpointer data);
void                ncm_func_eval_set_max_threads       (gint mt);
void                ncm_func_eval_threaded_loop         (NcmLoopFunc lfunc,
                                                         glong i,
                                                         glong f,
                                                         gpointer data);

Description

FIXME

Details

NcmLoopFunc ()

void                (*NcmLoopFunc)                      (glong i,
                                                         glong f,
                                                         gpointer data);

ncm_func_eval_set_max_threads ()

void                ncm_func_eval_set_max_threads       (gint mt);

Set the new maximun number of threads to be used by the pool

mt :

new max threads to be used in the pool, -1 means unlimited

ncm_func_eval_threaded_loop ()

void                ncm_func_eval_threaded_loop         (NcmLoopFunc lfunc,
                                                         glong i,
                                                         glong f,
                                                         gpointer data);

Using the thread pool, evaluate fl in each value of (f-i)/nthreads

lfunc :

NcmLoopFunc to be evaluated in threads. [scope notified]

i :

initial index

f :

final index

data :

pointer to be passed to fl