Skip to content

Binder: PyType.getInstance cache is a data race on a free-threaded build #160

Open

Description

@b-re-w

python/multiplatform/ffi/PyType.kt memoises into a plain mutableMapOf and relies on the caller holding the GIL (docs/design/threading-and-abi.md). On 3.14t two Kotlin threads creating types in parallel race on it; the desktop suite passing on 3.14t does not exercise that case.
Completion: a desktop 3.14t stress test with N threads calling PyType.getInstance concurrently that fails (or is flagged) before the fix; then a thread-safe cache. Related: #117.

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

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions