Skip to content

Native code due to freethreading #21

Open
@mikeshardmind

Description

@mikeshardmind

There's currently threading.RLock use in a few places strictly to have heapq use be safe under freethreading. This isn't a small penalty.

In 3.14+, this should be safe (double check at release, see: python/cpython#135036)

Options here include vendoring the 3.14 copy of the heapq module, implementing this natively with critical sections, dynamically importing versions of the code to only use the lock under freethreading + python < 3.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions