1
0
Fork 0

Rework extra threads

This commit is contained in:
Andreas Streichardt 2016-08-25 10:53:04 +02:00
parent 4939e02fb2
commit 378c800fb4
2 changed files with 4 additions and 7 deletions

View File

@ -43,7 +43,7 @@ DispatcherFeature::DispatcherFeature(
application_features::ApplicationServer* server) application_features::ApplicationServer* server)
: ApplicationFeature(server, "Dispatcher"), : ApplicationFeature(server, "Dispatcher"),
_nrStandardThreads(0), _nrStandardThreads(0),
_nrExtraThreads(0), _nrExtraThreads(-1),
_nrAqlThreads(0), _nrAqlThreads(0),
_queueSize(16384), _queueSize(16384),
_dispatcher(nullptr) { _dispatcher(nullptr) {
@ -72,7 +72,7 @@ void DispatcherFeature::collectOptions(
options->addHiddenOption("--server.extra-threads", 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", "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", options->addHiddenOption("--server.aql-threads",
"number of threads for basic operations (0 = automatic)", "number of threads for basic operations (0 = automatic)",
@ -102,10 +102,8 @@ void DispatcherFeature::validateOptions(std::shared_ptr<ProgramOptions>) {
TRI_ASSERT(_nrAqlThreads >= 1); TRI_ASSERT(_nrAqlThreads >= 1);
if (_nrExtraThreadsArgument < 0) { if (_nrExtraThreads < 0) {
_nrExtraThreads = _nrStandardThreads; _nrExtraThreads = _nrStandardThreads;
} else {
_nrExtraThreads = static_cast<uint64_t>(_nrExtraThreadsArgument);
} }
if (_queueSize <= 128) { if (_queueSize <= 128) {

View File

@ -52,9 +52,8 @@ class DispatcherFeature final
void unprepare() override final; void unprepare() override final;
private: private:
int64_t _nrExtraThreadsArgument;
uint64_t _nrStandardThreads; uint64_t _nrStandardThreads;
uint64_t _nrExtraThreads; int64_t _nrExtraThreads;
uint64_t _nrAqlThreads; uint64_t _nrAqlThreads;
uint64_t _queueSize; uint64_t _queueSize;