#include "zstd_deps.h"
#include "../zstd.h"
Go to the source code of this file.
◆ ZSTD_STATIC_LINKING_ONLY
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_customMem */ |
◆ POOL_ctx
◆ POOL_function
typedef void(* POOL_function) (void *) |
POOL_function : The function type that can be added to a thread pool.
◆ POOL_add()
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_create()
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
.
- Returns
- : POOL_ctx pointer on success, else NULL.
◆ POOL_create_advanced()
POOL_ctx * POOL_create_advanced |
( |
size_t | numThreads, |
|
|
size_t | queueSize, |
|
|
ZSTD_customMem | customMem ) |
◆ POOL_free()
◆ POOL_resize()
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.
- Returns
- : 0 when resize was successful, !0 (typically 1) if there is an error. note : only numThreads can be resized, queueSize remains unchanged.
◆ POOL_sizeof()
POOL_sizeof() :
- Returns
- threadpool memory usage note : compatible with NULL (returns 0 in this case)
◆ POOL_tryAdd()
POOL_tryAdd() : Add the job function(opaque)
to thread pool if a queue slot is available. Returns immediately even if not (does not block).
- Returns
- : 1 if successful, 0 if not.