boost::thread_resource_error improvements#427
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdjusted parallel evaluator core selection and hardened worker-thread creation. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/libexpr/parallel-eval.cc`:
- Around line 35-44: The loop should base fallback and the "enabled" mode on the
number of workers actually created rather than the requested evalCores: if
evalCores == 1 skip creating threads and leave parallel mode disabled; otherwise
perform the createWorker loop but after the loop compute size_t actual_workers =
state->threads.size() and use that to decide behavior (if actual_workers == 0
throw the original fatal Error, if actual_workers == 1 set executor as
disabled/serial and log a warning that only 1 worker was created, otherwise set
enabled = true); also update the existing log messages to reference
actual_workers instead of the loop index n so the reported count matches
state->threads.size().
🪄 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: b16c9616-d92e-4320-8e56-ed3eb7d8ca3d
📒 Files selected for processing (1)
src/libexpr/parallel-eval.cc
| { | ||
| return evalSettings.evalProfilerMode != EvalProfilerMode::disabled ? 1 | ||
| : evalSettings.evalCores == 0UL ? Settings::getDefaultCores() | ||
| : evalSettings.evalCores == 0UL ? std::min(32U, Settings::getDefaultCores()) |
There was a problem hiding this comment.
Would it be useful to add a small note explaining that this 32 figure is just because (as the commit message says) scalability sees diminishing returns? In case we ever fix these scalability issues, so we can again unlock much more parallelism...
Scalability bottlenecks currently cause diminishing returns above this. It also prevents creating huge numbers of threads on machines with lots of cores.
2b8879d to
5c862d7
Compare
Motivation
Context
Summary by CodeRabbit
Bug Fixes
Chores