This repository was archived by the owner on Feb 13, 2025. It is now read-only.
forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 61
WIP: Stackless issue #203: use the macro _PyStackless_TRY_STACKLESS #203
Closed
Conversation
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
…code Refactor the finalisation code of stackless.tasklet and stackless.channel. - For tasklets, use a PEP 442 finalizer; - for channels a simple tp_clear function is sufficient. Like every PEP 442 other finalizer, the new finalizer runs only once for each tasklet.
In order to prevent an endless loop in the tasklet-finalizer, try at most 10 times to kill a tasklet.
Move the handling of tasklets with non-trivial C-state from tasklet_traverse to tasklet_finalize. If a tasklet still has a non-trivial C-state after killing the tasklet, the finalizer appends the tasklet to gc.garbage. Now de-allocation caused by ref-counting behaves identically to de-allocation caused by GC. The gc-patch introduced by stackless-dev/stackless_historic@35ba34f18 is now obsolete.
Revert the patch, that added the function PyObject_GC_Collectable(). It was introduced by stackless-dev/stackless_historic@35ba34f18. See bpo-9141 for a discussion of this interesting patch.
Enable soft switching for iterators/coroutines called by "yield from". Work in progress, not functional, DO NOT MERGE!
…nd coroutines Improve the finalisation of a soft switched YIELD_FROM instruction.
…ed methods Enable stackless calls of the following methods: - generator.send() (generator.__next__() was already stackless); - coroutine.send(); - coroutine_wrapper.__next__() and coroutine_wrapper.send(); - async_generator_asend.__next__() and async_generator_asend.send(). This change needs more tests.
Fix a error handling in the YIELD_FROM finalisation code. Add tests and changelog.txt
…t.run" Enable stackless calls of method "contextvars.Context.run", if soft-switching is enabled.
…ctions Better handling of exceptions / NULL result values. Move the macros to manipulate the try-stackless floag to the API. Now it is possible to convert existing extension functions to stackless, without using internal API. Coming soon: test cases and documentation
Enable stackless calls of coroutines wrapped in "asyncio._CTask", if soft-switching is enabled. Needs test cases. Depends on pull request python#198.
…ctions Clean up the API header, add tests and documentation.
Remove an unused static function, add test cases and change-log.
instead of _PyRuntime.st.try_stackless.
Closed
akruis
pushed a commit
that referenced
this pull request
Jan 12, 2019
instead of _PyRuntime.st.try_stackless.
Manually merged, see commit 60f321a. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Replace
_PyRuntime.st.try_stackless
with the macro_PyStackless_TRY_STACKLESS
.Of this pull request only the commit f6dfdea and its children are relevant. This pull request must be merged only after pull request #198 has been merged.