Multithreaded Programming Guide

Get Thread Concurrency Level

pthread_getconcurrency(3THR)

pthread_getconcurrency(3THR) returns the value set by a previous call to pthread_setconcurrency(). If the pthread_setconcurrency() function was not previously called, pthread_getconcurrency() returns zero.

#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.