Standards / Extensions | C or C++ | Dependencies |
---|---|---|
z/OS® UNIX | both | POSIX(ON) |
#define _OPEN_SYS
#include <pthread.h>
int pthread_set_limit_np(int action, int maxthreadtasks, int maxthreads);
The pthread_set_limit_np() function allows you to control how many tasks and threads can be created for a process. On a single call, you can specify that you want to update either the maximum number of tasks, the maximum number of threads, or both. The maximum number of tasks and threads is dependent upon the size of the private area below 16M. A realistic limit is 200 to 400 tasks and threads.
For more information on the allowable values for maxthreadtasks and maxthreads, see the BPX1STL function in z/OS UNIX System Services Programming: Assembler Callable Services Reference.
If successful, pthread_set_limit_np() returns 0.
If unsuccessful, pthread_set_limit_np() returns -1.
For more information regarding return values and reason codes, see the BPX1STL function in z/OS UNIX System Services Programming: Assembler Callable Services Reference.