Repository navigation
TypedPython: OSR-style exit for snapshot holders (#152, option i) - #335
Merged
Merged
Conversation
… interpreter on change (#152, option i) A function holding a list copy-in or entry globals no longer starves other threads, signals and the free-threaded stop-the-world for the length of its loops. From the second TP_POLL_INTERVAL chunk on it writes its lists back, ends their critical section, polls, re-takes it, copies in again and re-checks lengths, exact element types and entry globals. Unchanged: it continues compiled. Changed: an OSR-style exit. The frontend generates, per loop, a Python continuation from the function's own source (resume.py: the rest of the function from that iteration, enclosing loops via a first-iteration flag, range bounds as evaluated, original lines and name); the impl boxes every live local and calls it, and the call returns what it returns. The wrapper hands the context to its impl through tp_tls so only that call polls with those lists. Functions whose locals cannot all be handed over (virtual objects, regions) keep the no-poll rule.
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.
Closes #152 (decision (i), user-approved: CPython identity).