GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing github.com — bpo-47215: Add undocumented, unstable FrameStack API for use by greenlets and similar libraries. by markshannon · Pull Request #32303 · python/cpython Conversation
|
| PyAPI_FUNC(int) _PyCrossInterpreterData_RegisterClass(PyTypeObject *, crossinterpdatafunc); | ||
| PyAPI_FUNC(crossinterpdatafunc) _PyCrossInterpreterData_Lookup(PyObject *); | ||
|
|
||
| /* UNSTABLE API for stackful coroutines. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
What about hiding this behind an ifdef, it would technically be an api break, but would make the intention clearer:
#ifdef _PYTHON_C_UNSTABLE_FRAMESTACK_API ... #endif
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, I didn't get a chance to look at this too closely today. My plan is to attempt to modify my fork of Greenlet tomorrow to see how well it works with this branch (and then we'll have a patch we can upstream right away, too). A few thoughts just from looking at this so far:
We can also loop in the Greenlet maintainers and get their opinion on this. @jamadden? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The default size is 64k, which is fine for a thread, but quite large for a coroutine. It costs nothing to expose it. The problem with a save/restore model is that it has too many states and error conditions. What state is the VM in after mutliple saves, with no restore? Or vice versa? For performance reasons the frame stack struct needs to be embedded in the thread state, so we can't return a pointer to it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.