|
a/src/utils/cpuconf.cpp |
|
b/src/utils/cpuconf.cpp |
|
... |
|
... |
24 |
#include <thread>
|
24 |
#include <thread>
|
25 |
|
25 |
|
26 |
// Go c++11 !
|
26 |
// Go c++11 !
|
27 |
bool getCpuConf(CpuConf& cpus)
|
27 |
bool getCpuConf(CpuConf& cpus)
|
28 |
{
|
28 |
{
|
|
|
29 |
#if defined(_WIN32)
|
|
|
30 |
// On windows, indexing is actually twice slower with threads
|
|
|
31 |
// enabled + there is a bug and the process does not exit at the
|
|
|
32 |
// end of indexing. Until these are solved, pretend there is only
|
|
|
33 |
// 1 cpu
|
|
|
34 |
cpus.ncpus = 1;
|
|
|
35 |
#else
|
29 |
// c++11
|
36 |
// c++11
|
30 |
cpus.ncpus = std::thread::hardware_concurrency();
|
37 |
cpus.ncpus = std::thread::hardware_concurrency();
|
|
|
38 |
#endif
|
|
|
39 |
|
31 |
return true;
|
40 |
return true;
|
32 |
}
|
41 |
}
|
33 |
|
42 |
|
34 |
#else // TEST_CPUCONF
|
43 |
#else // TEST_CPUCONF
|
35 |
|
44 |
|