FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Replace Stackless hard switching with libteatet by akruis · Pull Request #279 · stackless-dev/stackless · GitHub

This repository was archived by the owner on Feb 13, 2025. It is now read-only.
/ stackless Public archive
forked from python/cpython

Replace Stackless hard switching with libteatet - #279

Draft
akruis wants to merge 37 commits into
stackless-dev:2.7-slpfrom
akruis:2.7-slp-tealet
Draft

Replace Stackless hard switching with libteatet#279
akruis wants to merge 37 commits into
stackless-dev:2.7-slpfrom
akruis:2.7-slp-tealet

Conversation

akruis commented Jun 26, 2021

Copy link
Copy Markdown

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.

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.
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.

Copy link
Copy Markdown
Collaborator

Thanks, this is great for historical reasons :)

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL