You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current weakref implementation relies on the GIL for thread-safety.
The nogil-3.12 fork substantially modifies the weakref implementation. I think we can implement a simpler change in CPython 3.13 (main) now that all PyObject's have their own mutex (in --disable-gil builds).
Basic idea
Protect access to the weakrefs linked list using the mutex in the weakly referenced object. Use the critical section API.
Feature or enhancement
The current weakref implementation relies on the GIL for thread-safety.
The
nogil-3.12fork substantially modifies the weakref implementation. I think we can implement a simpler change in CPython 3.13 (main) now that all PyObject's have their own mutex (in--disable-gilbuilds).Basic idea
Protect access to the weakrefs linked list using the mutex in the weakly referenced object. Use the critical section API.
Prior implementation: colesbury/nogil-3.12@0dddcb6f9d
Linked PRs