-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
base: main
Are you sure you want to change the base?
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. |
@@ -45,8 +45,12 @@ else | |||
endif | |||
|
|||
cy = meson.get_compiler('cython') | |||
cdata = configuration_data() |
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 the configuration_data next to the configure_file
call? I assume here you did it to avoid repeating the cy.version()
check, but I think it reads easier to keep this all together
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)
IF CYTHON_COMPATIBLE_WITH_FREE_THREADING: | ||
new_referenced_blocks = [] | ||
for ref in self.referenced_blocks: | ||
status = PyWeakref_GetRef(ref, &pobj) |
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.
status = PyWeakref_GetRef(ref, &pobj) | |
cdef PyObject *status = PyWeakref_GetRef(ref, &pobj) |
Can you just declare / define all in one go? I don't think we need separate blocks for those (same comment for the status variable)