Skip to content

Add scoped Perl runtimes and isolate I/O state - #920

Merged
fglock merged 1 commit into
masterfrom
feature/perl-threads-phase-3
Aug 11, 2026
Merged

Add scoped Perl runtimes and isolate I/O state#920
fglock merged 1 commit into
masterfrom
feature/perl-threads-phase-3

Conversation

@fglock

@fglock fglock commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • add the empty PerlRuntime identity shell with strict scoped, non-inherited bindings
  • bind CLI, provider, JSR-223, require/do, and eval ownership boundaries
  • isolate standard handles, selected/last-handle bookkeeping, readline context, and open-handle caching per runtime
  • route standard globs and glob localization/deletion through the bound runtime
  • explicitly propagate runtime identity into pipe/system/process routers and Netty callbacks
  • update the final threads plan and mark Phases 3 and 4 complete

Phases 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 Config thread flags remain disabled.

Validation

  • make — passed
  • make test-all — passed; core 83.2%, bundled modules 80.8%
  • 24 focused I/O regression runs across JVM and interpreter backends — passed by process status
  • Scalar::Util 1.70 and Moo 2.005005 smoke tests — passed on both backends
  • IPC::Open3 and standard-glob lifecycle checks — passed on both backends
  • git diff --check — passed

The interpreter-only TAP miss in nonblocking_pipe_syswrite.t assertion 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. Perl threads remains unavailable until the later cloning and API activation phases.

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>
@fglock
fglock merged commit 1ee08c0 into master Aug 11, 2026
2 checks passed
@fglock
fglock deleted the feature/perl-threads-phase-3 branch August 11, 2026 10:43
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