-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Implement PEP 788 #133110
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
Draft
ZeroIntensity
wants to merge
62
commits into
python:main
Choose a base branch
from
ZeroIntensity:pep-788-impl
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Implement PEP 788 #133110
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
1828b9a
Implement interpreter state reference counting.
ZeroIntensity d0895f9
Add a test for interpreter reference counts.
ZeroIntensity 5c3ee8d
Add thread state daemon-ness that doesn't work yet.
ZeroIntensity 7b9ac59
Add untested implementation of non-daemon native threads.
ZeroIntensity 0868c15
Add a test for PyThreadState_SetDaemon().
ZeroIntensity e9ea644
Add untested implementation of Ensure()/Release() that probably doesn…
ZeroIntensity 0ebdca4
Change some comments.
ZeroIntensity 40989de
Add a test that I'm sure doesn't work.
ZeroIntensity d501f35
Use the interpreter's reference count and native thread countdown as …
ZeroIntensity c5ec89c
Fix the countdown decrement.
ZeroIntensity 4e1f599
Remove unused variable.
ZeroIntensity 3127a3f
Test for PyGILState_Ensure()
ZeroIntensity 82b5b9f
Fix the test for the new reference counting.
ZeroIntensity fda9886
Add PyInterpreterState_Lookup()
ZeroIntensity f7723c0
Fix a few bugs and add a test.
ZeroIntensity 62e9549
Add a test for PyThreadState_Ensure() across interpreters.
ZeroIntensity bc60630
Remove an artifact from old approach.
ZeroIntensity 9d8d526
Fix test from earlier semantics.
ZeroIntensity 54b0ce0
Remove 'daemonness' as a property of a thread.
ZeroIntensity 5955de6
Add strong interpreter reference functions.
ZeroIntensity 92cf906
Implement weak references.
ZeroIntensity b0d0673
Fix some thread safety issues regarding interpreter deletion.
ZeroIntensity 0a15beb
Merge from main branch.
ZeroIntensity 16d79de
Implement new version of PyThreadState_Ensure() and PyThreadState_Rel…
ZeroIntensity c2bffcd
Use the new APIs in the tests.
ZeroIntensity 911c6b5
Fix _testcapi.
ZeroIntensity b84fa90
Fix the ensure counter.
ZeroIntensity 9ccf6bd
Add the test to test_embed.
ZeroIntensity 481caf5
Allow the wait to be interrupted by CTRL+C.
ZeroIntensity 71e1aec
Print the error before bailing out.
ZeroIntensity d661578
Updates for the new proposal.
ZeroIntensity 4249c5d
Bikeshedding.
ZeroIntensity 71f2fd7
Apply suggestions from code review
ZeroIntensity 03ccb38
Fix failing build.
ZeroIntensity bca65fb
Rename parameter.
ZeroIntensity 510ade1
Fix formatting.
ZeroIntensity 3971408
Add tstate check.
ZeroIntensity 6c4c52b
Move to pycore_pystate.h
ZeroIntensity 64920a8
Revert "Move to pycore_pystate.h"
ZeroIntensity 05436f3
Use an exponential wait time for the event.
ZeroIntensity 02bc2d7
Mark function as static.
ZeroIntensity 03fa2af
Update fatal error message.
ZeroIntensity b955d85
Remove incorrect assertion.
ZeroIntensity 5236700
Add a comment regarding PyMem_RawMalloc()
ZeroIntensity a277130
Add a comment.
ZeroIntensity dac0c1a
Update Include/cpython/pystate.h
ZeroIntensity ab9e3b5
Merge branch 'pep-788-impl' of https://github.com/ZeroIntensity/cpyth…
ZeroIntensity 79a1852
Move some tests around to prevent exposure of the private API.
ZeroIntensity 47957b8
Move weakref test to internal C API.
ZeroIntensity 771d7ed
Improve reference counting tests.
ZeroIntensity 0c3c1c7
Remove dead function.
ZeroIntensity 531928e
Add some more tests.
ZeroIntensity 08a8af6
Remove unused variables.
ZeroIntensity 02f93bc
Fix some thread state attachment problems.
ZeroIntensity d6c82bd
Only delete thread states created by PyThreadState_Ensure()
ZeroIntensity 082fd69
Add a test for crossinterpreter ensures.
ZeroIntensity 61f70ae
Add a test for weak interpreter references.
ZeroIntensity fa961e9
Fix concurrent shutdown races in PyGILState_Ensure().
ZeroIntensity ea1da77
Add a test for PyInterpreterRef_Main().
ZeroIntensity 6f19384
Use PyErr_FormatUnraisable to show signals.
ZeroIntensity b702da2
Fix a re-entrancy deadlock.
ZeroIntensity 40e7e68
Remove stupid IDE imports.
ZeroIntensity File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Apply suggestions from code review
Co-authored-by: Victor Stinner <vstinner@python.org>
- Loading branch information
commit 71f2fd7d46831209a31dc18b22f493ba58852e9d
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move it to the internal C API? (Include/internal/pycore_pystate.h).
Same remark for _PyInterpreterState_Incref().
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_testcapi
doesn't allow importing from pycore headers. I only need these for those tests.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move tests to _testinternalcapi in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we're not testing the internal C API, we're testing the public C API. We just use the internal C API to write those tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't add private functions (ex:
_PyInterpreterState_Refcount()
) to the public C API. So move it to the internal C API. Sadly, it means moving your tests to the internal C API tests, unless a test only uses public functions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I split up the tests, so now the internal stuff is in
_testinternalcapi
and the internal functions are in the private headers.