refactor: create I/O services on first use - #373
Merged
Merged
Conversation
|
An automated preview of the documentation is available at https://373.corosio.prtest3.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-09-28 17:29:38 UTC |
|
GCOVR code coverage report https://373.corosio.prtest3.cppalliance.org/gcovr/index.html Build time: 2026-09-28 17:45:41 UTC |
sgerbino
force-pushed
the
pr/lazy-services
branch
from
September 28, 2026 17:24
71f0d2a to
ceb95da
Compare
Backend construct() registered every protocol service eagerly, and the scheduler constructors did the same for the resolver, signal, and file services, so every program linked the full service surface of every compiled backend. Registration now happens on first use. The abstract scheduler becomes a registry service keyed under its own type — the concrete schedulers already declared that key but the base was not findable — so services constructed from only an execution_context can locate the scheduler without naming a concrete backend type. Each public I/O object gets or creates its service through a per-protocol dispatch helper that probes which scheduler the context was built with, so the linker keeps only the services of the protocols a program actually names. Acceptor services get-or-create the stream service they hand accepted descriptors to.
sgerbino
force-pushed
the
pr/lazy-services
branch
from
September 28, 2026 17:24
ceb95da to
a1a8680
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend construct() registered every protocol service eagerly, and the scheduler constructors did the same for the resolver, signal, and file services, so every program linked the full service surface of every compiled backend.
Registration now happens on first use. The abstract scheduler becomes a registry service keyed under its own type — the concrete schedulers already declared that key but the base was not findable — so services constructed from only an execution_context can locate the scheduler without naming a concrete backend type. Each public I/O object gets or creates its service through a per-protocol dispatch helper that probes which scheduler the context was built with, so the linker keeps only the services of the protocols a program actually names. Acceptor services get-or-create the stream service they hand accepted descriptors to.