Skip to content

gh-112087: Make list.extend(dict) behave atomically #117438

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 1 commit into from
Apr 2, 2024

Conversation

colesbury
Copy link
Contributor

@colesbury colesbury commented Apr 1, 2024

Add a special case for list.extend(dict) and list(dict) so that those patterns behave atomically with respect to modifications to the list or dictionary when the GIL is disabled.

This is required by multiprocessing, which assumes that list(_finalizer_registry) is atomic.

Add a special case for `list.extend(dict)` and `list(dict)` so that
those patterns behave atomically with respect to modifications to the
list or dictionary.

This is required by multiprocessing, which assumes that
`list(_finalizer_registry)` is atomic.
Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

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

lgtm.

@colesbury colesbury merged commit 027fa2e into python:main Apr 2, 2024
39 checks passed
@colesbury colesbury deleted the gh-112087-dict branch April 2, 2024 14:45
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…17438)

Add a special case for `list.extend(dict)` and `list(dict)` so that those
patterns behave atomically with respect to modifications to the list or
dictionary.

This is required by multiprocessing, which assumes that
`list(_finalizer_registry)` is atomic.
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.

2 participants