Let WaitIfUpstreamIdle spin long enough to stay saturated by load_tester
This commit is contained in:
@@ -114,10 +114,17 @@ uint32_t calculate_safe_len(
|
||||
// Empty - busy wait
|
||||
} else if constexpr (wait_strategy ==
|
||||
WaitStrategy::WaitIfUpstreamIdle) {
|
||||
auto push = pushes.load(std::memory_order_relaxed);
|
||||
if (push == thread.local_pops) {
|
||||
pushes.wait(push, std::memory_order_relaxed);
|
||||
// We're allowed to spin as long as we eventually go to 0% cpu
|
||||
// usage on idle
|
||||
uint32_t push;
|
||||
for (int i = 0; i < 100000; ++i) {
|
||||
push = pushes.load(std::memory_order_relaxed);
|
||||
if (push != thread.local_pops) {
|
||||
goto dont_wait;
|
||||
}
|
||||
}
|
||||
pushes.wait(push, std::memory_order_relaxed);
|
||||
dont_wait:;
|
||||
} else {
|
||||
static_assert(wait_strategy == WaitStrategy::WaitIfStageEmpty);
|
||||
last_push.wait(thread.last_push_read[Is],
|
||||
|
||||
Reference in New Issue
Block a user