rust-lang / rust-lang/rust

Should `Mutex` and `Condvar` respect priorities?

Open
#128,231 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-atomic C-discussion T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

std does not have an API for setting the thread priority, and doesn't currently support priority inheritance on the majority of platforms (Linux and Windows in particular). Given this, does it still make sense to provide priority inheritance on any platform, when it is not guaranteed, won't be used by default and cannot be relied upon when using external libraries without inspecting the code? Or wouldn't it make more sense to deal with all the priority stuff in a separate crate? This would then allow reducing the number of synchronization primitive implementations inside std (we could switch to the queue-based variant on quite some platforms), thus simplifying efforts like #128203.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points; start by examining the standard library's Mutex and Condvar implementations and the platform support described in the issue. Read the related discussion in #128203, then determine whether priority handling should remain in std or move to a separate crate.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.