Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (n - p) pthread_setconcurrency(2)
NAME
pthread_setconcurrency - Sets level of concurrency
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
32-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/zputdll
64-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/yputdll
H-series and J-series OSS processes that use the Standard POSIX Threads library:
/G/system/zdllnnn/zsptdll
SYNOPSIS
#include <pthread.h> | #include <spthread.h>
/* pthread.h is required to use POSIX User Thread Model library */
/* spthread.h is required to use Standard POSIX Threads library */
int pthread_setconcurrency(int new_level);
DESCRIPTION
The pthread_setconcurrency() does not support thread scheduling. This function checks for I/O
completion when there is a context switch between threads and when the concurrency level is
met.
Concurrency values range from 0 to MAXINT inclusive. A concurrency level of 0 suggests to
the scheduler that the minimum possible amount of concurrency is required. Concurrency levels
greater than 0 suggest an increasingly higher level of concurrency.
The current implementation of concurrency level (Con Levl) and the minimum scheduled quan-
tum is as follows:
Con Levl Minimum Scheduled Quantum
--------- ----------------------------
0 Infinity
1 1 second
2 0.5 seconds
... ...
10 0.1 seconds
... ...
100 0.01 seconds
Note that the quantum is calculated using the formula, 1 / concurrency_level.
The default concurrency level for applications that use the POSIX User Thread Model library is
20; the default concurrency level for applications that use the Standard POSIX Threads library is
0.
On systems running H06.21 or later H-series RVUs or J06.10 or later J-series RVUs, you can use
either the POSIX User Thread Model library or the Standard POSIX Threads library for threaded
applications.
To use this function in a threaded application that uses the POSIX User Thread Model library on
systems running H06.21 or later RVUs or J06.10 or later RVUs, you must perform all of the fol-
lowing tasks:
527186-023 Hewlett-Packard Company 5171