-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Use futex-based thread::park/unpark on Linux. #76919
Conversation
r? @kennytm (rust_highfive has picked a reviewer for you, use r? to override) |
r? @dtolnay |
a2f2b42
to
fab849e
Compare
13ab12d
to
d3984ce
Compare
Hm, looks like WaitOnAddress is only available on Windows 8+, but the Rust documentation promises tier 1 support for Windows 7+. Reverting the Windows part for now. |
d3984ce
to
fab849e
Compare
7bceb2b
to
8782bc1
Compare
@rustbot modify labels: +T-libs +A-concurrency +O-linux |
8782bc1
to
0b73fd7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is fantastic.
@bors r+ |
📌 Commit 0b73fd7 has been approved by |
☀️ Test successful - checks-actions, checks-azure |
Tested on commit rust-lang/rust@7820135. Direct link to PR: <rust-lang/rust#76919> 💔 miri on linux: test-pass → test-fail (cc @oli-obk @eddyb @RalfJung).
This moves the parking/unparking logic out of
thread/mod.rs
into a module namedthread_parker
insys_common
. The current implementation is moved tosys_common/thread_parker/generic.rs
and the new implementation using futexes is added insys_common/thread_parker/futex.rs
.