-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
PyDict_Next should not lock the dict #120858
Copy link
Copy link
Closed
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixestopic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixestopic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Bug report
PyDict_Nextcurrently wraps_PyDict_Nextin a critical section. We shouldn't do this -- the locking needs to be external to the call._PyDict_Nextcall because we return borrowed references and becauseposbecomes meaningless if the dictionary gets resized or rehashed.cpython/Objects/dictobject.c
Lines 2883 to 2890 in 8f17d69
cc @DinoV
Linked PRs