feat(threads): implement phases 17 through 20 - #931
Merged
Conversation
Implement platform-thread ownership, runtime-family IDs, parent relationships, completion and error capture, one-shot join/detach transitions, and registry cleanup. Runtime snapshots created for managed threads retain the family registry without exposing the Perl threads API or changing Config flags. See dev/design/concurrency.md Phase 17. Generated with [Codex](https://openai.com/codex) Co-Authored-By: Codex <223018245+openai-codex[bot]@users.noreply.github.com>
Replace the detached harness stub with working create/new/async, identity, listing, state, join, detach, yield, and equality operations. The thread entry CODE reference and arguments share the runtime snapshot identity map; return values cross back through a new graph clone in the caller's context. Keep Config thread capability flags disabled until the activation phase. See dev/design/concurrency.md Phase 18. Generated with [Codex](https://openai.com/codex) Co-Authored-By: Codex <223018245+openai-codex[bot]@users.noreply.github.com>
Add a dedicated thread-exit unwind, retain uncaught errors for error(), run child-owned END queues before completion, support nested thread ownership, and clean joined or detached registry entries without unsafe Java thread stopping. Materialize lazy named subs before snapshots so child API calls do not retain parent-only compiler suppliers. The kill API remains an explicit no-op until a safe compatible mechanism is defined. See dev/design/concurrency.md Phase 19. Generated with [Codex](https://openai.com/codex) Co-Authored-By: Codex <223018245+openai-codex[bot]@users.noreply.github.com>
Implement threads::shared share, is_shared, and shared_clone plus real :shared attribute handling for scalar, array, and hash storage. Shared nodes retain identity across ithread graph clones, aggregates use synchronized backing collections, and scalar payloads provide cross-thread visibility. Reject blessed and tied storage in this first tranche; locks and condition variables remain Phase 21. Update the living design and attribute reference. See dev/design/concurrency.md Phase 20. Generated with [Codex](https://openai.com/codex) Co-Authored-By: Codex <223018245+openai-codex[bot]@users.noreply.github.com>
Rebase the phase 17-20 train onto the runtime fixes merged in PRs 927 and 930, then repair the remaining thread activation regressions. Keep lazy named subroutines lazy across runtime snapshots while rebinding their compiler suppliers to the source runtime and cloning the completed definition into the child. Avoid BEGIN-time compiler-lock deadlocks by retaining the detached stub boundary until ithreads are advertised. Also reject directory-only classpath resources from require, restoring the RT #24404 behavior after adding the threads/shared.pm resource directory. Generated with [Codex](https://openai.com/codex) Co-Authored-By: Codex <223018245+openai-codex[bot]@users.noreply.github.com>
fglock
force-pushed
the
feature/perl-threads-phases-17-20
branch
from
August 12, 2026 12:12
641e3d6 to
51cbf1d
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.
Summary
threadsAPI with identity-map cloning of entry CODE/arguments and context-correct cloning of join resultsthreads->exit, retained uncaught errors, nested threads, child-owned END handling, and explicit safe limitations forkillthreads::shared,share,is_shared,shared_clone, and real:sharedmarking for supported scalar/array/hash storageConfigthread capability flags disabled until the Phase 22 activation matrixCommit boundaries
Each commit preserves a functional compiler and is independently reviewable/revertible.
Validation
make— PASSmake test-all— completed successfully with the established partial-support baseline: core 83.1%, bundled modules 80.8%Deferred intentionally
Configactivation and the broader core/CPAN compatibility matrix (Phase 22)killsemantics