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
list(set)
should be atomic in the free-threaded build
#116621
Labels
Comments
This is also important for |
There are a few other cases in nogil-3.12 that we probably want to handle atomically as well, because I think we use the same pattern where the calling code assumes
|
corona10
added a commit
to corona10/cpython
that referenced
this issue
Mar 12, 2024
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
Mar 12, 2024
corona10
added a commit
that referenced
this issue
Mar 12, 2024
corona10
added a commit
to corona10/cpython
that referenced
this issue
Mar 14, 2024
corona10
added a commit
that referenced
this issue
Mar 15, 2024
corona10
added a commit
to corona10/cpython
that referenced
this issue
Mar 16, 2024
corona10
added a commit
that referenced
this issue
Mar 19, 2024
vstinner
pushed a commit
to vstinner/cpython
that referenced
this issue
Mar 20, 2024
vstinner
pushed a commit
to vstinner/cpython
that referenced
this issue
Mar 20, 2024
vstinner
pushed a commit
to vstinner/cpython
that referenced
this issue
Mar 20, 2024
adorilson
pushed a commit
to adorilson/cpython
that referenced
this issue
Mar 25, 2024
adorilson
pushed a commit
to adorilson/cpython
that referenced
this issue
Mar 25, 2024
adorilson
pushed a commit
to adorilson/cpython
that referenced
this issue
Mar 25, 2024
diegorusso
pushed a commit
to diegorusso/cpython
that referenced
this issue
Apr 17, 2024
diegorusso
pushed a commit
to diegorusso/cpython
that referenced
this issue
Apr 17, 2024
diegorusso
pushed a commit
to diegorusso/cpython
that referenced
this issue
Apr 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have code that constructs a list from a set, while the set may be concurrently updated. For example:
cpython/Lib/multiprocessing/process.py
Lines 61 to 65 in 44f9a84
This is a fairly common pattern currently, but in the free-threaded build, this may lead to
RuntimeError: Set changed size during iteration
. We should make it so thatlist(set)
locks the set to avoid the error and so that the list contains a consistent copy of the set.For additional context, see the following code from the nogil-3.12 fork:
cc @corona10
Linked PRs
The text was updated successfully, but these errors were encountered: