From 869426295448fe163ed1b8a68b5392ccde019ae6 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Mon, 19 Aug 2019 13:51:08 +0300
Subject: [PATCH] Allow thread pool size control

---
 components/common/cpp/src/configuration.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/components/common/cpp/src/configuration.cpp b/components/common/cpp/src/configuration.cpp
index 06cf11c85..786c07e5f 100644
--- a/components/common/cpp/src/configuration.cpp
+++ b/components/common/cpp/src/configuration.cpp
@@ -519,6 +519,10 @@ Configurable *ftl::config::configure(int argc, char **argv, const std::string &r
 	// Some global settings
 	ftl::timer::setInterval(rootcfg->value("fps",20));
 
+	int pool_size = rootcfg->value("thread_pool_factor", 2.0f)*std::thread::hardware_concurrency();
+	if (pool_size != ftl::pool.size()) ftl::pool.resize(pool_size);
+
+
 	//LOG(INFO) << "CONFIG: " << config["vision_default"];
 	//CHECK_EQ( &config, config_index["ftl://utu.fi"] );
 
-- 
GitLab