gh-92810: Lock-free cache implementation for ABCMeta (#162361)
* gh-92810: Lock-free cache implementation for ABCMeta
Replace the sets of weak references used for the ABC registry and the
positive/negative isinstance caches with hash tables keyed by class
identity. Cached isinstance() and issubclass() checks are served without
locking or reference count updates on the free-threaded build, and a
negative result is no longer propagated into the cache of every subclass
of the ABC, which made such checks quadratic for large hierarchies.
10 files changed