Skip to content

Fix thread-safety for PyType_IsSubtype in free-threaded builds #117306

Description

@mpage

Feature or enhancement

Proposal:

In #117275 we started performing reads of the MRO in PyType_IsSubtype in a thread-unsafe way. We need to read the MRO in a way that ideally doesn't lock, or at the very least locks without the possibility of suspending.

One potential solution is to use deferred reference counting to avoid locking.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions