summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-09-14 14:59:05 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2017-09-14 14:59:05 +0200
commit66cd305337c44b84589fb91e95d3d9662f8e6c5e (patch)
tree0ee43a40ab1d8a0b2b6e1ba837c97a6bfa011834 /searchcore
parentbeb641c2a972af3c992ce46407297e87c3d8e193 (diff)
Limit the number of task s in flight to 2x number of threads in the pool.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/executor_thread_service.h1
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/thread_service_observer.h10
2 files changed, 5 insertions, 6 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/executor_thread_service.h b/searchcore/src/vespa/searchcore/proton/server/executor_thread_service.h
index 47e41fcd1db..c938288c714 100644
--- a/searchcore/src/vespa/searchcore/proton/server/executor_thread_service.h
+++ b/searchcore/src/vespa/searchcore/proton/server/executor_thread_service.h
@@ -33,6 +33,7 @@ public:
return *this;
}
virtual bool isCurrentThread() const override;
+ size_t getNumThreads() const override { return _executor.getNumThreads(); }
};
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/test/thread_service_observer.h b/searchcore/src/vespa/searchcore/proton/test/thread_service_observer.h
index a2f0724d396..905ec5ef07b 100644
--- a/searchcore/src/vespa/searchcore/proton/test/thread_service_observer.h
+++ b/searchcore/src/vespa/searchcore/proton/test/thread_service_observer.h
@@ -3,8 +3,7 @@
#include <vespa/searchcorespi/index/i_thread_service.h>
-namespace proton {
-namespace test {
+namespace proton::test {
class ThreadServiceObserver : public searchcorespi::index::IThreadService
{
@@ -38,9 +37,8 @@ public:
virtual bool isCurrentThread() const override {
return _service.isCurrentThread();
}
-};
-
-} // namespace test
-} // namespace proton
+ size_t getNumThreads() const override { return _service.getNumThreads(); }
+};
+}