Skip to content

current_thread: deterministic_external_spawn builder option (+anthropic.2)#7

Closed
antsujay wants to merge 2 commits intoanthropics:anthropic-1.49.0from
antsujay:det-external-spawn-v1.49.0
Closed

current_thread: deterministic_external_spawn builder option (+anthropic.2)#7
antsujay wants to merge 2 commits intoanthropics:anthropic-1.49.0from
antsujay:det-external-spawn-v1.49.0

Conversation

@antsujay
Copy link
Copy Markdown
Collaborator

@antsujay antsujay commented Apr 14, 2026

Adds Builder::deterministic_external_spawn(bool) to the current_thread runtime. When enabled, Handle::spawn from outside the runtime thread (e.g. from spawn_blocking work) drains the inject queue into the local queue at a fixed point each tick instead of interleaving — making the resulting schedule deterministic under paused time.

39-line patch on top of v1.49.0+anthropic.1.

cc @njs

Drains inject→local before each task pop. For deterministic-simulation
testing where a coordinated worker thread spawns onto the runtime while
the executor is blocked.
@antsujay antsujay closed this Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant