diff options
author | Sam Gross <colesbury@gmail.com> | 2024-06-24 18:15:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-24 18:15:15 (GMT) |
commit | 375b723d5873f948696c7e85a97f4778d9e00ff0 (patch) | |
tree | 081f3b0fffac79d58c7b1e3cc81e8a9bdc2e3373 /Misc/NEWS.d | |
parent | dee63cb35971b87a09ddda5d6f29cd941f570720 (diff) | |
download | cpython-375b723d5873f948696c7e85a97f4778d9e00ff0.zip cpython-375b723d5873f948696c7e85a97f4778d9e00ff0.tar.gz cpython-375b723d5873f948696c7e85a97f4778d9e00ff0.tar.bz2 |
gh-120858: PyDict_Next should not lock the dict (#120859)
PyDict_Next no longer locks the dictionary in the free-threaded build. Locking
around individual PyDict_Next calls is not sufficient because the function
returns borrowed references and because it allows concurrent modifications
during the iteraiton loop.
The internal locking also interferes with correct external synchronization
because it may suspend outer critical sections created by the caller.
Diffstat (limited to 'Misc/NEWS.d')
-rw-r--r-- | Misc/NEWS.d/next/C API/2024-06-21-16-41-21.gh-issue-120858.Z5_-Mn.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/C API/2024-06-21-16-41-21.gh-issue-120858.Z5_-Mn.rst b/Misc/NEWS.d/next/C API/2024-06-21-16-41-21.gh-issue-120858.Z5_-Mn.rst new file mode 100644 index 0000000..b5df2a5 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2024-06-21-16-41-21.gh-issue-120858.Z5_-Mn.rst @@ -0,0 +1,3 @@ +:c:func:`PyDict_Next` no longer locks the dictionary in the free-threaded +build. The locking needs to be done by the caller around the entire iteration +loop. |