Documentation Home >> Headers >> <thread> Header >> std::thread >> std::thread::hardware_concurrency static Member Function

Return a hint as to the number of threads that can run concurrently on the current hardware.

unsigned hardware_concurrency();

Returns:

The number of threads that can run concurrently on the current hardware. This may be the number of processors in the system for example. Where this information is not available or well-defined this function returns 0.

Throws:

Nothing

Header

#include <thread>

See Also