mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Fix selection of # threads, set default to 1 thread
This commit is contained in:
parent
28c50c16cd
commit
f00d136ab1
@ -187,7 +187,7 @@ void set_default_settings(Settings *settings)
|
|||||||
settings->setDefault("emergequeue_limit_total", "256");
|
settings->setDefault("emergequeue_limit_total", "256");
|
||||||
settings->setDefault("emergequeue_limit_diskonly", "");
|
settings->setDefault("emergequeue_limit_diskonly", "");
|
||||||
settings->setDefault("emergequeue_limit_generate", "");
|
settings->setDefault("emergequeue_limit_generate", "");
|
||||||
settings->setDefault("num_emerge_threads", "");
|
settings->setDefault("num_emerge_threads", "1");
|
||||||
|
|
||||||
// physics stuff
|
// physics stuff
|
||||||
settings->setDefault("movement_acceleration_default", "3");
|
settings->setDefault("movement_acceleration_default", "3");
|
||||||
|
@ -56,8 +56,7 @@ EmergeManager::EmergeManager(IGameDef *gamedef, BiomeDefManager *bdef) {
|
|||||||
if (g_settings->get("num_emerge_threads").empty()) {
|
if (g_settings->get("num_emerge_threads").empty()) {
|
||||||
int nprocs = porting::getNumberOfProcessors();
|
int nprocs = porting::getNumberOfProcessors();
|
||||||
// leave a proc for the main thread and one for some other misc threads
|
// leave a proc for the main thread and one for some other misc threads
|
||||||
if (nprocs > 2)
|
nthreads = (nprocs > 2) ? nthreads = nprocs - 2 : 1;
|
||||||
nthreads = nprocs - 2;
|
|
||||||
} else {
|
} else {
|
||||||
nthreads = g_settings->getU16("num_emerge_threads");
|
nthreads = g_settings->getU16("num_emerge_threads");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user