Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163522415
D56614.id176322.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D56614.id176322.diff
View Options
diff --git a/contrib/kyua/engine/config.cpp b/contrib/kyua/engine/config.cpp
--- a/contrib/kyua/engine/config.cpp
+++ b/contrib/kyua/engine/config.cpp
@@ -33,6 +33,9 @@
#endif
#include <stdexcept>
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#endif
#include "engine/exceptions.hpp"
#include "engine/execenv/execenv.hpp"
@@ -85,10 +88,13 @@
supported.insert(execenv::default_execenv_name);
tree.set< config::strings_set_node >("execenvs", supported);
- // TODO(jmmv): Automatically derive this from the number of CPUs in the
- // machine and forcibly set to a value greater than 1. Still testing
- // the new parallel implementation as of 2015-02-27 though.
- tree.set< config::positive_int_node >("parallelism", 1);
+ long nproc = 1;
+#if defined(_SC_NPROCESSORS_ONLN)
+ /// Non-standard but works on BSD, Linux, Solaris
+ if ((nproc = sysconf(_SC_NPROCESSORS_ONLN)) < 1)
+ nproc = 1;
+#endif
+ tree.set< config::positive_int_node >("parallelism", nproc);
tree.set< config::string_node >("platform", KYUA_PLATFORM);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 25, 2:36 AM (11 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35459633
Default Alt Text
D56614.id176322.diff (1 KB)
Attached To
Mode
D56614: kyua: Enable parallelism by default
Attached
Detach File
Event Timeline
Log In to Comment