多线程编程指南

获取线程并行级别

pthread_getconcurrency(3C) 返回先前调用 pthread_setconcurrency() 时设置的值。

pthread_getconcurrency 语法

#include <pthread.h>



int pthread_getconcurrency(void);

如果以前未调用 pthread_setconcurrency() 函数,则 pthread_getconcurrency() 将返回零。

pthread_getconcurrency 返回值

pthread_getconcurrency() 始终会返回先前调用 pthread_setconcurrency() 时设置的并发级别。如果从未调用 pthread_setconcurrency(),则 pthread_getconcurrency() 将返回零。