std::thread::hardware_concurrency()该函数返回CPU核心的数量,当系统无法获取时,函数返回0
#include <thread>
unsigned int nCpu = std::max(std::thread::hardware_concurrency(),(unsigned int)1);
微信扫一扫
std::thread::hardware_concurrency()该函数返回CPU核心的数量,当系统无法获取时,函数返回0
#include <thread>
unsigned int nCpu = std::max(std::thread::hardware_concurrency(),(unsigned int)1);
相关推荐