【发布时间】:2016-05-03 09:42:42
【问题描述】:
我正在使用 RHEL 6 64 位并在四核处理器上的虚拟机上运行。我编写了以下程序来检查硬件可以处理的线程数。
#include <thread>
#include <iostream>
using namespace std;
int main()
{
cout << thread::hardware_concurrency() << endl;
return 0;
}
结果总是零,这是什么原因?
【问题讨论】:
标签: c++ multithreading threadpool