You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(io_context): concurrency_hint heuristic and single_threaded tie-up
Two related improvements to io_context construction:
1. Static heuristic for inline budget defaults: when concurrency_hint
> 1 and the user has not customized budget options, override
(init, max, unassisted) to (0, 0, 0). Multi-thread workloads
benefit from cross-thread work-stealing, which "post everything"
enables; single-thread keeps the (2, 16, 4) chaining defaults.
2. Tie concurrency_hint == 1 to single_threaded mode (asio precedent):
constructing an io_context with concurrency_hint == 1 now forces
opts.single_threaded = true, eliminating scheduler locking on the
hot path. Matches asio's one_thread_ behavior. To opt out, pass
concurrency_hint > 1.
Supporting changes:
- reactor_scheduler: short-circuit try_consume_inline_budget and
reset_inline_budget when inline_budget_max_ == 0 so post-everything
mode skips TLS-list walks; relax configure_reactor validation to
allow budget_max == 0; fix max(1, x) * 2 in ramp-up to escape zero.
- io_context: apply_options_pre_/post_ now take concurrency_hint;
new private configure_single_threaded_() helper used by the
bare-hint and template no-opts constructors.
- docs: update 4c2.configuration.adoc and io_context_options field
docs to describe the queue-empty gating and new defaults.
0 commit comments