aboutsummaryrefslogtreecommitdiff
path: root/src/daemon
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-04-28 20:25:33 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-04-28 20:33:59 +0100
commit513a658c87b5fa23533a6b6db36e6d36af6a861d (patch)
treeaca5ae90aec55ec7495d3f5faa9c6b3904b279c6 /src/daemon
parentMerge pull request #823 (diff)
downloadmonero-513a658c87b5fa23533a6b6db36e6d36af6a861d.tar.xz
add a --max-concurrency flag
It sets the max number of threads to use for a parallel job. This is different that the number of total threads, since monero binaries typically start a lot of them.
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/command_line_args.h5
-rw-r--r--src/daemon/main.cpp4
2 files changed, 9 insertions, 0 deletions
diff --git a/src/daemon/command_line_args.h b/src/daemon/command_line_args.h
index 2dca5e3e7..1fe2ddcf6 100644
--- a/src/daemon/command_line_args.h
+++ b/src/daemon/command_line_args.h
@@ -59,6 +59,11 @@ namespace daemon_args
"os-version"
, "OS for which this executable was compiled"
};
+ const command_line::arg_descriptor<unsigned> arg_max_concurrency = {
+ "max-concurrency"
+ , "Max number of threads to use for a parallel job"
+ , 0
+ };
} // namespace daemon_args
#endif // DAEMON_COMMAND_LINE_ARGS_H
diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp
index 0717fd89b..bfd829dea 100644
--- a/src/daemon/main.cpp
+++ b/src/daemon/main.cpp
@@ -81,6 +81,7 @@ int main(int argc, char const * argv[])
bf::path default_log = default_data_dir / std::string(CRYPTONOTE_NAME ".log");
command_line::add_arg(core_settings, daemon_args::arg_log_file, default_log.string());
command_line::add_arg(core_settings, daemon_args::arg_log_level);
+ command_line::add_arg(core_settings, daemon_args::arg_max_concurrency);
daemonizer::init_options(hidden_options, visible_options);
daemonize::t_executor::init_options(core_settings);
@@ -260,6 +261,9 @@ int main(int argc, char const * argv[])
);
}
+ if (command_line::has_arg(vm, daemon_args::arg_max_concurrency))
+ tools::set_max_concurrency(command_line::get_arg(vm, daemon_args::arg_max_concurrency));
+
_note_c("dbg/main", "Moving from main() into the daemonize now.");
return daemonizer::daemonize(argc, argv, daemonize::t_executor{}, vm);