Skip to main content

ec_thread_pool_create_module

Last updated March 2020

Name

ec_thread_pool_create_module — Create a module thread pool

Synopsis

#include "ec_thread_pool.h"

| int **ec_thread_pool_create_module** ( | self, |   | |   | type, |   | |   | concurrency, |   | |   | stack_size, |   | |   | max_queue_len); |   |

generic_module_infrastructure * <var class="pdparam">self</var>; const char * <var class="pdparam">type</var>; int <var class="pdparam">concurrency</var>; size_t <var class="pdparam">stack_size</var>; size_t <var class="pdparam">max_queue_len</var>;

Description

Create a module thread pool.

Parameters

self

The module reference. For a description of this data type see generic_module_infrastructure.

type

The thread pool type, io, for example. See also threadpool.

concurrency

The concurrency of the thread pool.

stack_size

The stack size. If the stack size is 0, then the system default will be used.

max_queue_len

If this parameter is non zero, then a semaphore will be employed to prevent the queue length exceeding this value.

Return Values

On success this function returns the pool ID; on failure, -1 is returned.

Threading

It is legal to call this function in the Scheduler thread.

See Also

Was this page helpful?