diff options
author | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2021-04-29 15:32:26 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2021-04-29 15:32:26 +0000 |
commit | 3d34041283d66938c3164ae0761754a3790a455f (patch) | |
tree | 4daf7ccb77e89be742656067b6cb80487e775d6f | |
parent | 42c2917d2093673a8ca4658d6d800d9b2d8ee4ee (diff) |
Fix typo and add some TODOs for follow-ups
3 files changed, 4 insertions, 1 deletions
diff --git a/storage/src/tests/distributor/distributor_stripe_pool_test.cpp b/storage/src/tests/distributor/distributor_stripe_pool_test.cpp index 089400bc18c..408027eb894 100644 --- a/storage/src/tests/distributor/distributor_stripe_pool_test.cpp +++ b/storage/src/tests/distributor/distributor_stripe_pool_test.cpp @@ -36,6 +36,7 @@ struct DistributorStripePoolThreadingTest : Test { void loop_park_unpark_cycle_until_test_time_expired() { constexpr size_t min_cycles = 100; size_t cycle = 0; + // TODO enforce minimum number of actual calls to tick() per thread? while ((cycle < min_cycles) || !min_test_time_reached()) { _pool.park_all_threads(); _is_parked = true; diff --git a/storage/src/vespa/storage/distributor/distributor_stripe_pool.cpp b/storage/src/vespa/storage/distributor/distributor_stripe_pool.cpp index 6c819aab821..715d95e70fb 100644 --- a/storage/src/vespa/storage/distributor/distributor_stripe_pool.cpp +++ b/storage/src/vespa/storage/distributor/distributor_stripe_pool.cpp @@ -35,7 +35,7 @@ void DistributorStripePool::park_all_threads() noexcept { } void DistributorStripePool::unpark_all_threads() noexcept { - // Thread pool is not dynamic and unpark_thread(0 is thread safe. + // Thread pool is not dynamic and unpark_thread() is thread safe. for (auto& s : _stripes) { s->unpark_thread(); } diff --git a/storage/src/vespa/storage/distributor/distributor_stripe_thread.cpp b/storage/src/vespa/storage/distributor/distributor_stripe_thread.cpp index 5edbc45b8d6..7359fbe5cf8 100644 --- a/storage/src/vespa/storage/distributor/distributor_stripe_thread.cpp +++ b/storage/src/vespa/storage/distributor/distributor_stripe_thread.cpp @@ -76,6 +76,8 @@ void DistributorStripeThread::wait_until_unparked() noexcept { } void DistributorStripeThread::notify_event_has_triggered() noexcept { + // TODO mutex protect and add flag for "should tick immediately next time" + // TODO only notify if _waiting_for_event == true _event_cond.notify_one(); } |