Skip to content

Priority-inheritance futex is not used when implementing Mutex and RwLock #131514

Closed as not planned
@ruihe774

Description

@ruihe774

Maybe a duplication of #128231?

AFAIK Mutex and RwLock try to support priority inheritance (and that is why it uses pthread mutex in macOS). I'm curious why they just use normal futexes (FUTEX_WAIT_BITSET and FUTEX_WAKE in sys/pal/unix/futex.rs) and do not utilize priority-inheritance futexes on platforms that support PI futexes, namely FUTEX_LOCK_PI in Linux and UMUTEX_PRIO_INHERIT in FreeBSD. IMO PI futexes have better cooperation with the system scheduler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions