In C++, the standard library provides the unsigned int std::thread::hardware_concurrency();
function as a platform-independent way to get the number of available concurrent threads at runtime.
In Golang, the same information is provided by the GOMAXPROCS
environment variable which is provided by the runtime.
Does C (including standard and common multithreading libraries, like pthreads
) have any such high-level API for getting the number of concurrent threads in a platform-independent way, or is it required to parse system information files to get that kind of information?