Fix exec::thread_pool_base customization of bulk - #2226
Conversation
…rrectly handle non-parallel execution policies
|
/ok to test 7214721 |
@Cra3z, looks like you need to bump up the timeout for this test. |
|
@ericniebler Uh... odd, I've never touched the |
# Conflicts: # include/exec/thread_pool_base.hpp
|
@ericniebler I dug into this one — it does reproduce, but I don't think raising the ReproductionPinning ctest to a single core (plus a few competing spinners, to emulate a Root causeThe owner's push loop yields, but the thief loop has no backoff at all: stdexec/test/exec/test_bwos_lifo_queue.cpp Lines 352 to 364 in 6720837 thief, line 376 — pure busy-spin: stdexec/test/exec/test_bwos_lifo_queue.cpp Lines 372 to 389 in 6720837 With 8 thieves burning full quanta on a mostly-failing
A watchdog confirms Possible fixGive the thief loop the same backoff the push loop already has: {
break;
}
+ else
+ {
+ std::this_thread::yield();
+ }
}
thiefCounts[t] = localCount;
}); |
Fix the missing customization of
bulk_unchunkedinexec::thread_pool_base. Additionally, the currentbulkcustomization inexec::thread_pool_baseexecutes in parallel regardless of the execution policy, which is incorrect. It should only execute in parallel across multiple execution agents when the policy isstd::execution::parorstd::execution::par_unseq; otherwise, it should fall back to sequential execution on a single execution agent.fixes #1687