Skip to content
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

Implement locked iteration for PyList #4789

Merged
merged 16 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions newsfragments/4789.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Added `PyList::locked_for_each`, which is equivalent to `PyList::for_each` on
the GIL-enabled build and uses a critical section to lock the list on the
free-threaded build, similar to `PyDict::locked_for_each`.
2 changes: 2 additions & 0 deletions newsfragments/4789.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Operations that process a PyList via an iterator now use a critical section
on the free-threaded build to amortize synchronization cost and prevent race conditions.
Loading
Loading