Multithreaded Programming Guide

Get Thread Concurrency Level

pthread_getconcurrency(3T)

pthread_getconcurrency(3T) returns the value set by a previous call to pthread_setconcurrency(). If the pthread_setconcurrency() function was not previously called, pthread_getconcurrency() returns zero to indicate that the implementation is maintaining the concurrency level. (For Solaris threads, see "thr_getconcurrency(3T)".)

#include <pthread.h>

int pthread_getconcurrency(void);

Return Value

pthread_getconcurrency() always returns the concurrency level set by a previous call to pthread_setconcurrency(). If pthread_setconcurrency() has never been called, pthread_getconcurrency() returns zero.