-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Add "unstable" frame stack api #91371
Comments
We need to provide an API to create, swap and free frame stacks for greenlets. Since this is primarily for greenlets (and any other stackful coroutines libraries that want to use it) it will be "unstable". In this case, by "unstable" I mean:
The API will be:
|
greenlet code to save the Python thread state (C++): https://github.com/python-greenlet/greenlet/blob/937f150e07823ee03344aeeb5111c0bb371a831d/src/greenlet/TPythonState.cpp#L111 greenlet is used by eventlet and gevent projects. PyOdide has similar code (in C): https://github.com/pyodide/pyodide/blob/d317e66d174efa203c59f094eb7714c0b90f7613/src/core/stack_switching/pystate.c#L161-L187 |
cc @hoodmane |
Experimental change to move "save/restore the frame stack" into a dedicated C API in CPython upstream: python/cpython#91371
Experimental greenlet change extracting the "save/restore" logic into a C API: python-greenlet/greenlet#407 |
Members which should be saved/restored per Python version. Python 3.10 (4):
Python 3.11 (8):
Python 3.12 (8):
For Python 3.13, I'm not sure. I found 8 members:
|
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: