Add scoped Perl runtimes and isolate I/O state - #920
Merged
Conversation
Introduce the PerlRuntime identity shell and strict scoped ThreadLocal bindings across CLI, embedding, require, and eval entry points. Preserve binding ownership across nested calls and reject missing propagation at internal runtime boundaries. Move standard handles, selected/last-handle bookkeeping, readline context, and open-handle caching behind the bound runtime. Route standard globs and their localization/deletion lifecycle per runtime, and explicitly propagate runtime identity into I/O routers, process copiers, and Netty callbacks. Add deterministic binding, lifecycle, engine-isolation, glob-lifecycle, readline-emission, and worker-propagation coverage. Keep remaining runtime state and Config thread flags unchanged until later phases described in dev/design/concurrency.md. Generated with [Codex](https://openai.com/codex) Co-Authored-By: Codex <223018245+openai-codex[bot]@users.noreply.github.com>
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.
Summary
PerlRuntimeidentity shell with strict scoped, non-inherited bindingsPhases 3 and 4 are intentionally combined in this PR at maintainer direction. All other mutable interpreter state remains process-global, concurrent full Perl execution is not yet advertised, and
Configthread flags remain disabled.Validation
make— passedmake test-all— passed; core 83.2%, bundled modules 80.8%git diff --check— passedThe interpreter-only TAP miss in
nonblocking_pipe_syswrite.tassertion 8 was reproduced on the exact PR #918 base; it is pre-existing. Its JVM run and the remaining focused assertions pass.Next phase
After merge, Phase 5 migrates execution, local-save, dynamic-scope, and special-block stacks into
PerlRuntime. Perlthreadsremains unavailable until the later cloning and API activation phases.