From 3bf169720b147bd5322e190469e134d99ff424d6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Oct 2017 12:12:49 +0200 Subject: Adjust max-threads multiplier for 32-bit because of stack size increase --- build2/b-options.cxx | 2 +- build2/b.cli | 2 +- build2/scheduler.cxx | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'build2') diff --git a/build2/b-options.cxx b/build2/b-options.cxx index 5041cf3..6ee835d 100644 --- a/build2/b-options.cxx +++ b/build2/b-options.cxx @@ -714,7 +714,7 @@ namespace build2 os << std::endl << "\033[1m--max-jobs\033[0m|\033[1m-J\033[0m \033[4mnum\033[0m Maximum number of jobs (threads) to create. The default is" << ::std::endl - << " 16x the number of active jobs (--jobs|j\033[0m) on 32-bit" << ::std::endl + << " 8x the number of active jobs (--jobs|j\033[0m) on 32-bit" << ::std::endl << " architectures and 32x on 64-bit. See the build system" << ::std::endl << " scheduler implementation for details." << ::std::endl; diff --git a/build2/b.cli b/build2/b.cli index 46cf80a..8148702 100644 --- a/build2/b.cli +++ b/build2/b.cli @@ -387,7 +387,7 @@ namespace build2 size_t --max-jobs|-J { "", - "Maximum number of jobs (threads) to create. The default is 16x the + "Maximum number of jobs (threads) to create. The default is 8x the number of active jobs (\c{--jobs|j}) on 32-bit architectures and 32x on 64-bit. See the build system scheduler implementation for details." } diff --git a/build2/scheduler.cxx b/build2/scheduler.cxx index 6ffbdc4..f7b10e9 100644 --- a/build2/scheduler.cxx +++ b/build2/scheduler.cxx @@ -243,11 +243,12 @@ namespace build2 // lock l (mutex_); - // Use 16x max_active on 32-bit and 32x max_active on 64-bit. Unless we + // Use 8x max_active on 32-bit and 32x max_active on 64-bit. Unless we // were asked to run serially. // if (max_threads == 0) - max_threads = max_active * (max_active == 1 ? 1 : sizeof (void*) * 4); + max_threads = (max_active == 1 ? 1 : + sizeof (void*) < 8 ? 8 : 32) * max_active; assert (shutdown_ && init_active != 0 && -- cgit v1.1