Skip to content

Commit 8965e65

Browse files
authored
Merge pull request #959 from lonvia/reduce-parallel-connections
Reduce max number of default parallel threads to 4
2 parents 5af06a7 + b7cd589 commit 8965e65

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

options.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#define basename /*SKIP IT*/
99
#endif
1010
#include <boost/format.hpp>
11+
#include <algorithm>
1112
#include <cstdio>
1213
#include <cstring>
1314
#include <osmium/version.hpp>
@@ -300,7 +301,7 @@ options_t::options_t()
300301
output_backend("pgsql"), input_reader("auto"), bbox(boost::none),
301302
extra_attributes(false), verbose(false)
302303
{
303-
num_procs = std::thread::hardware_concurrency();
304+
num_procs = (int) std::min(4U, std::thread::hardware_concurrency());
304305
if (num_procs < 1) {
305306
fprintf(stderr, "WARNING: unable to detect number of hardware threads supported!\n");
306307
num_procs = 1;

0 commit comments

Comments
 (0)