From 0d8ba1776f74261843bc9532bab1ca670c88bf40 Mon Sep 17 00:00:00 2001 From: Ivan Chvets Date: Tue, 4 Jun 2024 10:01:56 -0400 Subject: [PATCH] feat: use env var to specify number of cpus for scheduler Summary of changes: - Modified code to use env vat to specify number of CPUs for generic scheduler. If not set, system value is taken. Signed-off-by: Ivan Chvets --- src/GenericScheduler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GenericScheduler.h b/src/GenericScheduler.h index eb2b0a07..7c8cc217 100644 --- a/src/GenericScheduler.h +++ b/src/GenericScheduler.h @@ -26,7 +26,7 @@ namespace OpenWifi { private: GenericScheduler() noexcept : SubSystemServer("Scheduler", "SCHEDULER", "scheduler"), - Scheduler_(Poco::Environment::processorCount()*2) { + Scheduler_(((int)std::stoi(Poco::Environment::get("GENERIC_SCHEDULER_CORES", std::to_string(Poco::Environment::processorCount()))))*2) { } Bosma::Scheduler Scheduler_;