Stay single-threaded on windows, multithread is slower and exit does not work
This commit is contained in:
parent
5584e3aa1d
commit
0294f6ca6d
1 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue