cthreadpool · Section 3
cthrpool_create
NAME
cthrpool_create - create a thread pool with default memory management
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cthreadpool.h>
cthrpool cthrpool_create(size_t num_threads,
size_t queue_capacity,
char **err_str);
DESCRIPTION
A wrapper around cthrpool_create_mp with mprocs = NULL, so the pool uses the standard malloc and free for every allocation it makes.
PARAMETERS
num_threads Number of worker threads (must be >= 1)
queue_capacity 0 for unbounded; N > 0 for bounded. ccol_invalid_size
is refused (see cthrpool_create_mp(3)).
err_str Optional. It gets a static error string on failure
RETURN VALUE
Returns a new cthrpool handle on success, or CTHRPOOL_NULL on failure. A process with no thread-specific key left to give gets CTHRPOOL_NULL from this call and from every later one; see cthrpool_create_mp(3).