From 88caae135a2e6fa18c9236836dffc53bb6209b8a Mon Sep 17 00:00:00 2001 From: Jano Simas Date: Wed, 2 May 2018 16:16:43 -0300 Subject: [PATCH 1/2] limit number of analysis threads --- src/terrama2/services/analysis/core/Service.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/terrama2/services/analysis/core/Service.cpp b/src/terrama2/services/analysis/core/Service.cpp index d6020f5a2..1f5dfdbb8 100644 --- a/src/terrama2/services/analysis/core/Service.cpp +++ b/src/terrama2/services/analysis/core/Service.cpp @@ -136,7 +136,8 @@ void terrama2::services::analysis::core::Service::connectDataManager() void terrama2::services::analysis::core::Service::start(size_t threadNumber) { terrama2::core::Service::start(threadNumber); - threadPool_.reset(new ThreadPool(processingThreadPool_.size())); + threadNumber = verifyNumberOfThreads(threadNumber)/2; + threadPool_.reset(new ThreadPool(threadNumber)); } void terrama2::services::analysis::core::Service::erasePreviousResult(terrama2::core::ProcessPtr process, std::shared_ptr timestamp) const From 30dc5b47a8a08dfe47f13e5b00c33cfabc391270 Mon Sep 17 00:00:00 2001 From: Jano Simas Date: Thu, 3 May 2018 08:17:10 -0300 Subject: [PATCH 2/2] round up number of threads --- src/terrama2/services/analysis/core/Service.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/terrama2/services/analysis/core/Service.cpp b/src/terrama2/services/analysis/core/Service.cpp index 1f5dfdbb8..218f42d53 100644 --- a/src/terrama2/services/analysis/core/Service.cpp +++ b/src/terrama2/services/analysis/core/Service.cpp @@ -136,7 +136,7 @@ void terrama2::services::analysis::core::Service::connectDataManager() void terrama2::services::analysis::core::Service::start(size_t threadNumber) { terrama2::core::Service::start(threadNumber); - threadNumber = verifyNumberOfThreads(threadNumber)/2; + threadNumber = std::ceil((threadNumber)/2); threadPool_.reset(new ThreadPool(threadNumber)); }