![]() |
GHOST
1.1.2
General, Hybrid, and Optimized Sparse Toolkit
|
#include "ghost/config.h"
#include "ghost/thpool.h"
#include "ghost/util.h"
#include "ghost/machine.h"
Functions | |
ghost_error | ghost_thpool_create (int nThreads, void *(func)(void *)) |
ghost_error | ghost_thpoolhread_add (void *(func)(void *), intptr_t arg) |
ghost_error | ghost_thpool_destroy () |
Destroy the thread pool. More... | |
ghost_error | ghost_thpool_get (ghost_thpool **thp) |
Get the thread pool. More... | |
ghost_error | ghost_thpool_key (pthread_key_t *key) |
Variables | |
static pthread_key_t | ghost_thread_key = 0 |
Each of the threads in the thread pool gets assigned the task it executes via pthread_setspecific. This is the key to this specific data. It is exported in ghost_taskq.h. More... | |
static ghost_thpool * | thpool = NULL |
The thread pool created by ghost_thpool_create(). More... | |
ghost_error ghost_thpool_create | ( | int | nThreads, |
void * | func)(void * | ||
) |
ghost_error ghost_thpool_destroy | ( | ) |
Destroy the thread pool.
Before free'ing the resources, all pthreads in the thread pool are being joined (this is also where an error could occur).
ghost_error ghost_thpool_get | ( | ghost_thpool ** | thpool | ) |
Get the thread pool.
thpool | Where to store the thread pool. |
ghost_error ghost_thpool_key | ( | pthread_key_t * | key | ) |
ghost_error ghost_thpoolhread_add | ( | void * | func)(void *, |
intptr_t | arg | ||
) |
|
static |
Each of the threads in the thread pool gets assigned the task it executes via pthread_setspecific. This is the key to this specific data. It is exported in ghost_taskq.h.
|
static |
The thread pool created by ghost_thpool_create().