forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Stackless hard switching with libteatet #279
Draft
akruis
wants to merge
37
commits into
stackless-dev:2.7-slp
Choose a base branch
from
akruis:2.7-slp-tealet
base: 2.7-slp
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
The main tealet (the one calling in to python) must be suspended and the top level tasklet evaluation loop run in a worker, because soft switching may have the main tasklet run in an arbitrary tealet when it exits. It then needs to switch back to the 'main' tealet. The only way to do this is to have the 'main' tealet in a known state. In the old system, it was possible to switch back to a known state of the main stack, creating a duplicate on the fly. Tealets are more strict because a tealet are more like threads: each can only run a function, not extend back from its invocation point.
This is safe and recommended, structs have their own namespace and their names don't clash with typedefs.
tealet to return to. This also removes then need to tweak it in the test_outside function.
re-implement stackless.uncollectable.
The platf/ files are still present in the repo.
Fix cleanup to work properly.
We now just call a callback for the initial stub. There is no need to mess with cframes and such stuff.
This is a lot of legacy, it should all work through tealets now.
soft-swiching of the main tasklet, and the consequence of the main tasklet being executed on a different stack when it exits, it is much simpler to simply force hard switching for the main tasklet. This means that the main tasklet always runs on the stack provided by the caller into the python library, including whatever stack exception handlers they provided. This removes the need to have the main tealet suspended while stackless runs.
Unittest test_thread are broken here and need fixing.
Thanks, this is great for historical reasons :) |
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.
This is the historical patch for issue #10 from Kristján Valur Jónsson.
I converted this patch from a backup of the original mercurial repository available from https://bitbucket-archive.softwareheritage.org/projects/kr/krisvale/stackless-tealet.html.