From 13bfea1fc1945f17ce32b797aded43da912bb6ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Sat, 25 May 2024 13:23:42 +0200 Subject: [PATCH] Differentiate between node IO runners and general IO --- nano/lib/thread_roles.cpp | 3 +++ nano/lib/thread_roles.hpp | 1 + nano/nano_node/daemon.cpp | 2 +- nano/nano_rpc/entry.cpp | 2 +- nano/nano_wallet/entry.cpp | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/nano/lib/thread_roles.cpp b/nano/lib/thread_roles.cpp index 76211682e4..91258315bc 100644 --- a/nano/lib/thread_roles.cpp +++ b/nano/lib/thread_roles.cpp @@ -19,6 +19,9 @@ std::string nano::thread_role::get_string (nano::thread_role::name role) case nano::thread_role::name::io: thread_role_name_string = "I/O"; break; + case nano::thread_role::name::io_daemon: + thread_role_name_string = "I/O (daemon)"; + break; case nano::thread_role::name::work: thread_role_name_string = "Work pool"; break; diff --git a/nano/lib/thread_roles.hpp b/nano/lib/thread_roles.hpp index d6d78b694f..17e10c2fc9 100644 --- a/nano/lib/thread_roles.hpp +++ b/nano/lib/thread_roles.hpp @@ -11,6 +11,7 @@ enum class name { unknown, io, + io_daemon, work, message_processing, vote_processing, diff --git a/nano/nano_node/daemon.cpp b/nano/nano_node/daemon.cpp index 283e6342a0..e172e18f72 100644 --- a/nano/nano_node/daemon.cpp +++ b/nano/nano_node/daemon.cpp @@ -146,7 +146,7 @@ void nano::daemon::run (std::filesystem::path const & data_path, nano::node_flag logger.info (nano::log::type::daemon, "Start time: {:%c} UTC", fmt::gmtime (dateTime)); // IO context runner should be started first and stopped last to allow asio handlers to execute during node start/stop - runner = std::make_unique (io_ctx, logger, node->config.io_threads); + runner = std::make_unique (io_ctx, logger, node->config.io_threads, nano::thread_role::name::io_daemon); node->start (); diff --git a/nano/nano_rpc/entry.cpp b/nano/nano_rpc/entry.cpp index e1bb22f400..9e062fb684 100644 --- a/nano/nano_rpc/entry.cpp +++ b/nano/nano_rpc/entry.cpp @@ -51,7 +51,7 @@ void run (std::filesystem::path const & data_path, std::vector cons std::shared_ptr io_ctx = std::make_shared (); - runner = std::make_unique (io_ctx, logger, rpc_config.rpc_process.io_threads); + runner = std::make_unique (io_ctx, logger, rpc_config.rpc_process.io_threads, nano::thread_role::name::io_daemon); try { diff --git a/nano/nano_wallet/entry.cpp b/nano/nano_wallet/entry.cpp index 51471f6cb6..3fa835b749 100644 --- a/nano/nano_wallet/entry.cpp +++ b/nano/nano_wallet/entry.cpp @@ -124,7 +124,7 @@ int run_wallet (QApplication & application, int argc, char * const * argv, std:: std::shared_ptr io_ctx = std::make_shared (); - nano::thread_runner runner (io_ctx, logger, config.node.io_threads); + nano::thread_runner runner (io_ctx, logger, config.node.io_threads, nano::thread_role::name::io_daemon); std::shared_ptr node; std::shared_ptr gui;