Skip to content

gh-126907: Use a list for atexit callbacks #127935

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

Merged
merged 19 commits into from
Dec 16, 2024

Conversation

ZeroIntensity
Copy link
Member

@ZeroIntensity ZeroIntensity commented Dec 14, 2024

cc @colesbury, @vstinner, @kumaraditya303

This is an alternative to gh-126908, and I'm a lot happier with this. Sam's suggestion of using a list turned out to be pretty nice, with the exception of unregister being a little wonky. I suspect we could improve that a little by adding a private API for removing from a list more cleanly, but that's work for later. FWIW, both this PR and the other one will have trouble backporting due to the runtime structure changing size.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the overall change. Here is a first review.

ZeroIntensity and others added 7 commits December 16, 2024 08:16

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Kumar Aditya <[email protected]>
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Co-authored-by: Victor Stinner <[email protected]>

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@kumaraditya303 kumaraditya303 enabled auto-merge (squash) December 16, 2024 19:02
@kumaraditya303 kumaraditya303 merged commit 3b76682 into python:main Dec 16, 2024
41 checks passed
@ZeroIntensity ZeroIntensity deleted the atexit-nogil branch December 16, 2024 19:31
@vstinner
Copy link
Member

Congrats @ZeroIntensity for this nice fix!

kumaraditya303 added a commit to kumaraditya303/cpython that referenced this pull request Dec 17, 2024
kumaraditya303 added a commit to kumaraditya303/cpython that referenced this pull request Dec 17, 2024
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants