Skip to content

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

Merged
merged 9 commits into from
Feb 27, 2025

Conversation

lysnikolaou
Copy link
Contributor

@lysnikolaou lysnikolaou requested a review from WillAyd as a code owner December 11, 2024 15:08
@lysnikolaou lysnikolaou force-pushed the lock-block-values-refs branch from 4e28feb to e21c3c9 Compare December 11, 2024 15:10
@rhshadrach rhshadrach added Enhancement Build Library building on various platforms Python 3.13 labels Dec 27, 2024
@jbrockmendel
Copy link
Member

Perf impact?

@mroeschke
Copy link
Member

IIUC we'll need to wait for the next cython release based on your PR cython/cython#6538?

@lysnikolaou
Copy link
Contributor Author

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.

new_referenced_blocks = []
for ref in self.referenced_blocks:
status = PyWeakref_GetRef(ref, &pobj)
if status == 1:
Copy link
Member

@WillAyd WillAyd Jan 24, 2025

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)

Copy link
Contributor Author

@lysnikolaou lysnikolaou Jan 27, 2025

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,
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@github-actions github-actions bot added the Stale label Feb 27, 2025
@lysnikolaou
Copy link
Contributor Author

Can this PR be merged? Is there something else I can do to push it forward?

@mroeschke mroeschke removed the Stale label Feb 27, 2025
@mroeschke mroeschke added this to the 3.0 milestone Feb 27, 2025
@mroeschke mroeschke merged commit 5da9eb7 into pandas-dev:main Feb 27, 2025
93 of 94 checks passed
@mroeschke
Copy link
Member

Thanks @lysnikolaou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms Enhancement Python 3.13
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants