Stay single-threaded on windows, multithread is slower and exit does not work

This commit is contained in:
Jean-Francois Dockes 2016-08-06 12:20:06 +02:00
parent 5584e3aa1d
commit 0294f6ca6d

View file

@ -26,8 +26,17 @@
// Go c++11 ! // Go c++11 !
bool getCpuConf(CpuConf& cpus) bool getCpuConf(CpuConf& cpus)
{ {
#if defined(_WIN32)
// On windows, indexing is actually twice slower with threads
// enabled + there is a bug and the process does not exit at the
// end of indexing. Until these are solved, pretend there is only
// 1 cpu
cpus.ncpus = 1;
#else
// c++11 // c++11
cpus.ncpus = std::thread::hardware_concurrency(); cpus.ncpus = std::thread::hardware_concurrency();
#endif
return true; return true;
} }