[Previous] [Contents] [Index] [Next]

thread_pool_control()

Control the thread pool behaviour

Synopsis:

#include <sys/iofunc.h>
#include <sys/dispatch.h>

thread_pool_control( thread_pool_t * pool,
                     thread_pool_attr_t * attr,
                     uint16_t lower,
                     uint16_t upper,
                     unsigned flags )

Library:

libc

Description:

The thread_pool_control() function is used to specify the thread pool behaviour and adjust the attributes of the thread pool.

The following values may be set in flags:

THREAD_POOL_CONTROL_HIWATER
Adjust the high-water value of the number of threads allowed in the thread pool.
THREAD_POOL_CONTROL_INCREMENT
Adjust the increment value of the number of threads.
THREAD_POOL_CONTROL_LOWATER
Adjust the low-water value of the number of threads allowed in the thread pool.
THREAD_POOL_CONTROL_MAXIMUM
Adjust the maximum value of the number of threads allowed in the thread pool.
THREAD_POOL_CONTROL_NONBLOCK
Don't block while creating threads.

This function blocks until the number of threads created is between the range of upper and lower respectively, unless the THREAD_POOL_CONTROL_NONBLOCK bit is set in flags.


Note: Having several threads call this function with the same thread pool handle isn't recommended.

Returns:

-1 if an error occurs (errno is set).

Classification:

QNX 6

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler No
Thread Yes

See also:

thread_pool_destroy(), thread_pool_create(), thread_pool_limits(), thread_pool_start()


[Previous] [Contents] [Index] [Next]