[V4] Explicit scheduling#104
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@benchmark/src/libfork/switch_random.cpp`:
- Around line 89-95: The split logic for threads_total uses threads_a and
threads_b but forcibly sets threads_b = 1 when zero, which turns a 1-thread run
into two workers; change the behavior so threads_b is not silently increased:
compute threads_a = (threads_total + 1) / 2 and threads_b = threads_total -
threads_a and if threads_b == 0, leave it zero (or clamp to max(0,...)) and
adjust downstream code that constructs pool_b to skip creating pool_b when
threads_b == 0; update any code that assumes pool_b exists to handle the
zero-worker case (references: variables threads_total, threads_a, threads_b and
the pool creation logic in switch_random.cpp).
In `@test/src/explicit_scheduling.cpp`:
- Around line 757-759: The split currently over-allocates by one because pool_b
is constructed with thr - half + 1; change the construction of TestType pool_b
to use thr - half so the two pools sum to thr (i.e., replace TestType pool_b{thr
- half + 1} with TestType pool_b{thr - half}), keeping the computation of half
(std::size_t const half = thr / 2 + (thr % 2)) and the existing TestType
pool_a{half} unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: de3c1a9b-eed7-4aac-adc4-d4418adab1c1
📒 Files selected for processing (16)
CMakeLists.txtbenchmark/src/libfork/CMakeLists.txtbenchmark/src/libfork/switch_io_pool.cppbenchmark/src/libfork/switch_random.cppsrc/batteries/deque.cxxsrc/batteries/slab_stack.cxxsrc/core/awaitables.cxxsrc/core/concepts/awaitable.cxxsrc/core/core.cxxsrc/core/execute.cxxsrc/core/final_suspend.cxxsrc/core/handles.cxxsrc/core/promise.cxxtest/src/adaptors.cpptest/src/concepts.cpptest/src/explicit_scheduling.cpp
Summary by CodeRabbit
New Features
Bug Fixes
Tests