Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ruihe774 opened this issue Oct 10, 2024 · 0 comments
Open
Labels
C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@ruihe774
Copy link

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.

@ruihe774 ruihe774 added the C-bug Category: This is a bug. label Oct 10, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 10, 2024
@jieyouxu jieyouxu added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Oct 11, 2024
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants