Skip to content

core: give Bridge an executor bound to its own thread, so the threading guarantee is structural for Bridge-mediated calls too #588

Description

@Yaraslaut

Surfaced while implementing #568 (PR #585), filed per that PR's "Gaps in #567's surface" section rather than folded in, since it needs a decision and change that belongs with #571, not with #568.

The finding

Completion delivers to whatever executor the caller passes it. For registration, that caller is Bridge, which owns no event loop and no strand of its own — so the only executor Bridge's four dispatch sites (registerHandlerImpl, ensureBoundAsync, attachHandlerAsync, assignHandlerPrimary) can honestly name is exec::detail::inlineExecutor(): "deliver wherever you settled." That is exactly the prose contract #567/#568/#569 exist to replace with something structural — but naming inlineExecutor() doesn't structurally guarantee anything; it just restates "wherever you settled" as a value instead of as a sentence in a doc comment.

bindModel/promoteModel (#567's structural surface) made backends honest about which thread they settle on. They did not give Bridge, the framework's own caller of those verbs, a thread to name. So:

What's missing

Bridge would need to hold an executor bound to the thread that runs ~Bridge, and no ticket in the #522 set (#568/#569/#570/#571) currently owns adding one. This is the difference between "the guarantee is structural" (true of backends now) and "the decision is structural" (not yet true of Bridge) — see PR #585's "Decisions still open" section for the fuller writeup.

Status

Verified by reading: Bridge's four dispatch sites in include/morph/core/bridge.hpp all pass inlineExecutor(); exec::detail::inlineExecutor()'s definition confirms it runs the continuation inline on whichever thread settles the Completion. Not a reproduced defect — a scope gap in the #522 ticket set. Relevant to #571 before it claims its acceptance criteria are met.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreSubsystem: coreenhancementNew feature or requesttriage: validWell-framed; implement as written

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions