Frees a result 'r' and if free_data is true also frees the internal r->data result too.
Destroys a thread pool. The threads are joined into the main thread so they will finish their current work load.
Adds an item to the work pool.
Creates a worker pool with n worker threads.
Destroys a thread pool without waiting on jobs to complete. Use hts_tpool_kill(p) to quickly exit after a fatal error.
Pulls the next item off the process result queue. The caller should free it (and any internals as appropriate) after use. This doesn't wait for a result to be present.
Pulls the next item off the process result queue. The caller should free it (and any internals as appropriate) after use. This will wait for a result to be present if none are currently available.
Attach and detach a thread process-queue with / from the thread pool scheduler.
Deallocates memory for a thread process-queue. Must be called before the thread pool is destroyed.
Attach and detach a thread process-queue with / from the thread pool scheduler.
Returns true if there are no items in the process results queue and also none still pending.
Flushes the process-queue, but doesn't exit. This simply drains the queue and ensures all worker threads have finished their current tasks associated with this process.
Initialises a thread process-queue.
Returns the number of completed jobs in the process results queue.
Returns the process queue size
Increment and decrement the reference count in a process-queue. If the queue is being driven from two external (non thread-pool) threads, eg "main" and a "reader", this permits each end to decrement its use of the process-queue independently.
Increment and decrement the reference count in a process-queue. If the queue is being driven from two external (non thread-pool) threads, eg "main" and a "reader", this permits each end to decrement its use of the process-queue independently.
Resets a process to the initial state.
Shutdown a process.
Returns the number of completed jobs in the process results queue plus the number running and queued up to run.
Returns the data portion of a hts_tpool_result, corresponding to the actual "result" itself.
Returns the number of requested threads for a pool.
Wakes up a single thread stuck in dispatch and make it return with errno EAGAIN.
The single pool structure itself.
An hts_tpool_process implements a queue of input jobs to process and a queue of resulting output post-processing. Internally it consists of two buffered queues, analogous to the pipes in a unix pipeline: ...input | process | output...
An output, after job has executed.