From 378c800fb4a05a875831df7cf543e34e157c0fb9 Mon Sep 17 00:00:00 2001 From: Andreas Streichardt Date: Thu, 25 Aug 2016 10:53:04 +0200 Subject: [PATCH] Rework extra threads --- arangod/Dispatcher/DispatcherFeature.cpp | 8 +++----- arangod/Dispatcher/DispatcherFeature.h | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/arangod/Dispatcher/DispatcherFeature.cpp b/arangod/Dispatcher/DispatcherFeature.cpp index 789af99722..d49e6dbfbb 100644 --- a/arangod/Dispatcher/DispatcherFeature.cpp +++ b/arangod/Dispatcher/DispatcherFeature.cpp @@ -43,7 +43,7 @@ DispatcherFeature::DispatcherFeature( application_features::ApplicationServer* server) : ApplicationFeature(server, "Dispatcher"), _nrStandardThreads(0), - _nrExtraThreads(0), + _nrExtraThreads(-1), _nrAqlThreads(0), _queueSize(16384), _dispatcher(nullptr) { @@ -72,7 +72,7 @@ void DispatcherFeature::collectOptions( options->addHiddenOption("--server.extra-threads", "number of extra threads that can additionally be created when all regular threads are blocked and the client requests thread creation", - new Int64Parameter(&_nrExtraThreadsArgument)); + new Int64Parameter(&_nrExtraThreads)); options->addHiddenOption("--server.aql-threads", "number of threads for basic operations (0 = automatic)", @@ -102,10 +102,8 @@ void DispatcherFeature::validateOptions(std::shared_ptr) { TRI_ASSERT(_nrAqlThreads >= 1); - if (_nrExtraThreadsArgument < 0) { + if (_nrExtraThreads < 0) { _nrExtraThreads = _nrStandardThreads; - } else { - _nrExtraThreads = static_cast(_nrExtraThreadsArgument); } if (_queueSize <= 128) { diff --git a/arangod/Dispatcher/DispatcherFeature.h b/arangod/Dispatcher/DispatcherFeature.h index 26e9b25e7e..2083b8b336 100644 --- a/arangod/Dispatcher/DispatcherFeature.h +++ b/arangod/Dispatcher/DispatcherFeature.h @@ -52,9 +52,8 @@ class DispatcherFeature final void unprepare() override final; private: - int64_t _nrExtraThreadsArgument; uint64_t _nrStandardThreads; - uint64_t _nrExtraThreads; + int64_t _nrExtraThreads; uint64_t _nrAqlThreads; uint64_t _queueSize;