![]() |
Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
|
Data Structures | |
| struct | POOL_ctx_s |
Functions | |
| POOL_ctx * | POOL_create (size_t numThreads, size_t queueSize) |
| POOL_ctx * | POOL_create_advanced (size_t numThreads, size_t queueSize, ZSTD_customMem customMem) |
| void | POOL_free (POOL_ctx *ctx) |
| void | POOL_joinJobs (POOL_ctx *ctx) |
| int | POOL_resize (POOL_ctx *ctx, size_t numThreads) |
| void | POOL_add (POOL_ctx *ctx, POOL_function function, void *opaque) |
| int | POOL_tryAdd (POOL_ctx *ctx, POOL_function function, void *opaque) |
| size_t | POOL_sizeof (const POOL_ctx *ctx) |
| void POOL_add | ( | POOL_ctx * | ctx, |
| POOL_function | function, | ||
| void * | opaque ) |
POOL_add() : Add the job function(opaque) to the thread pool. ctx must be valid. Possibly blocks until there is room in the queue. Note : The function may be executed asynchronously, therefore, opaque must live until function has been completed.
| POOL_ctx * POOL_create | ( | size_t | numThreads, |
| size_t | queueSize ) |
POOL_create() : Create a thread pool with at most numThreads threads. numThreads must be at least 1. The maximum number of queued jobs before blocking is queueSize.
| POOL_ctx * POOL_create_advanced | ( | size_t | numThreads, |
| size_t | queueSize, | ||
| ZSTD_customMem | customMem ) |
| void POOL_free | ( | POOL_ctx * | ctx | ) |
POOL_free() : Free a thread pool returned by POOL_create().
| void POOL_joinJobs | ( | POOL_ctx * | ctx | ) |
POOL_joinJobs() : Waits for all queued jobs to finish executing.
POOL_resize() : Expands or shrinks pool's number of threads. This is more efficient than releasing + creating a new context, since it tries to preserve and re-use existing threads. numThreads must be at least 1.
| int POOL_tryAdd | ( | POOL_ctx * | ctx, |
| POOL_function | function, | ||
| void * | opaque ) |
POOL_tryAdd() : Add the job function(opaque) to thread pool if a queue slot is available. Returns immediately even if not (does not block).