diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-02-27 21:56:04 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-02-27 21:56:04 +0000 |
commit | 40e67dea90605c430fae7e010090886f137d5107 (patch) | |
tree | 08c71a39ef44a12f7558348ef23f3b472b6de498 /searchlib | |
parent | e114a0390b0aeb493a922ed3f90d0b90c7ad3c7f (diff) |
Add comment about thread safety.
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/common/sequencedtaskexecutor.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/searchlib/src/vespa/searchlib/common/sequencedtaskexecutor.h b/searchlib/src/vespa/searchlib/common/sequencedtaskexecutor.h index a7a223dd23a..0f0be52ecdd 100644 --- a/searchlib/src/vespa/searchlib/common/sequencedtaskexecutor.h +++ b/searchlib/src/vespa/searchlib/common/sequencedtaskexecutor.h @@ -31,7 +31,12 @@ public: void executeTask(ExecutorId id, vespalib::Executor::Task::UP task) override; void sync() override; Stats getStats() override; - static std::unique_ptr<ISequencedTaskExecutor> create(uint32_t threads, uint32_t taskLimit = 1000, Optimize optimize = Optimize::THROUGHPUT); + + /* + * Note that if you choose Optimize::THROUGHPUT, you must ensure only a single producer, or synchronize on the outside. + */ + static std::unique_ptr<ISequencedTaskExecutor> + create(uint32_t threads, uint32_t taskLimit = 1000, Optimize optimize = Optimize::LATENCY); }; } // namespace search |