-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Use PyWeakref_GetRef and critical section in BlockValuesRefs #60540
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
Use PyWeakref_GetRef and critical section in BlockValuesRefs #60540
Conversation
lysnikolaou
commented
Dec 11, 2024
- Related to ENH: Python 3.13 free-threading support #59057
- All code checks passed.
4e28feb
to
e21c3c9
Compare
Perf impact? |
IIUC we'll need to wait for the next cython release based on your PR cython/cython#6538? |
I've updated this PR so that it's not blocked on a Cython release. A review would be very helpful. The failing CI jobs seem to be unrelated: The pyodide one fails on main as well, and the manylinux one seems to be related to a docker fail, will probably be okay if rerun. |
pandas/_libs/internals.pyx
Outdated
new_referenced_blocks = [] | ||
for ref in self.referenced_blocks: | ||
status = PyWeakref_GetRef(ref, &pobj) | ||
if status == 1: |
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.
So if the reference is dead we are intentionally doing nothing here right? We don't need to handle that at all?
(I'm not very familiar with the referencing here)
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.
No need to do anything for dead references. Only thing we're doing here is basically removing any dead references from the referenced_blocks
list by creating a new list with all the live ones.
input: 'free_threading_config.pxi.in', | ||
output: 'free_threading_config.pxi', | ||
configuration: cdata, | ||
install: false, |
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.
Shouldn't we be installing the header? Doesn't that put it in the wheel?
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.
My understanding is that this is not needed since this is only required at Cython compilation time, and the wheel only includes compiled extensions.
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
Can this PR be merged? Is there something else I can do to push it forward? |
Thanks @lysnikolaou |