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 atomic-type-creation commit (2f08c98) covered the two highest-
contention caches. Wider audit found more plain Dictionary / HashSet
collections on hot paths that tear under free-threaded Python and
also fire Debug.Assert on GIL builds at sufficient contention.
Convert them to ConcurrentDictionary:
- ModuleObject.cache and ModuleObject.allNames - hit on every
Module.Attr access; the old HashSet.Add for allNames could miss
add-once semantics under contention and the Dictionary.Remove on
teardown could observe a torn map.
- Interop.delegateTypes - racing past TryGetValue with the old plain
Dictionary threw on Add ("duplicate key") instead of silently
picking one winner, which became reproducible on high concurrency.
- ClassBase.ClearVisited - re-entrancy guard for tp_clear, hit from
both the main thread and the .NET finalizer thread; the plain
HashSet tore reliably under FT.
Also tidy the existing ClassManager / TypeManager / ExtensionType
ConcurrentDictionary references via a using-directive instead of
fully qualifying System.Collections.Concurrent at every site.
0 commit comments