Repository navigation
gh-132296: Use thread-state reference counting to fix PyEval_SetTraceAllThreads - #132298
Closed
ZeroIntensity wants to merge 9 commits into
Closed
ZeroIntensity wants to merge 9 commits into
ZeroIntensity wants to merge 9 commits into
Conversation
Member
Author
|
@colesbury -- As you implemented tstate refcounts, I'd like to hear your opinion on this. Do you think using reference counting before finalization is a good idea? |
Member
Author
|
I realize that this only fixes concurrent deletion, but not concurrent mutation. Silly me. |
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 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 extends the
refcountfield to affectPyThreadState_Deleteand friends, letting us keep a thread state alive for slightly longer. This mechanism is far from being robust, because we're still not preventing the thread state from being cleared or other bad things, but it's a really nice start.We could go the route of letting the reference count field prevent any finalization happening to the thread state, but I want to hear opinions on this approach first.
PyEval_SetTrace#132296