gh-112075: Add critical sections for most dict APIs by DinoV · Pull Request #114508 · python/cpython

@DinoV DinoV changed the title Nogil dict locks gh-112075: Add critical sections for most dict APIs

Jan 23, 2024

@DinoV DinoV marked this pull request as ready for review

January 24, 2024 20:26

colesbury

colesbury

colesbury

@DinoV

@DinoV

fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this pull request

Feb 14, 2024
)

Starts adding thread safety to dict objects.


Use @critical_section for APIs which are exposed via argument clinic and don't directly correlate with a public C API which needs to acquire the lock
Use a _lock_held suffix for keeping changes to complicated functions simple and just wrapping them with a critical section
Acquire and release the lock in an existing function where it won't be overly disruptive to the existing logic

@DinoV DinoV deleted the nogil_dict_locks branch

May 31, 2024 18:23