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

std: Optimize thread park/unpark implementation #45524

Merged
merged 1 commit into from
Oct 27, 2017

Conversation

alexcrichton
Copy link
Member

This is an adaptation of rust-lang/futures-rs#597 for the standard library.
The goal here is to avoid locking a mutex on the "fast path" for thread
park/unpark where you're waking up a thread that isn't sleeping or otherwise
trying to park a thread that's already been notified. Mutex performance varies
quite a bit across platforms so this should provide a nice consistent speed
boost for the fast path of these functions.

This is an adaptation of rust-lang/futures-rs#597 for the standard library.
The goal here is to avoid locking a mutex on the "fast path" for thread
park/unpark where you're waking up a thread that isn't sleeping or otherwise
trying to park a thread that's already been notified. Mutex performance varies
quite a bit across platforms so this should provide a nice consistent speed
boost for the fast path of these functions.
@rust-highfive
Copy link
Collaborator

r? @dtolnay

(rust_highfive has picked a reviewer for you, use r? to override)

@dtolnay
Copy link
Member

dtolnay commented Oct 25, 2017

@bors r+

@bors
Copy link
Contributor

bors commented Oct 25, 2017

📌 Commit 6511e46 has been approved by dtolnay

@kennytm kennytm added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 25, 2017
@bors
Copy link
Contributor

bors commented Oct 27, 2017

⌛ Testing commit 6511e46 with merge 1855aff...

bors added a commit that referenced this pull request Oct 27, 2017
std: Optimize thread park/unpark implementation

This is an adaptation of rust-lang/futures-rs#597 for the standard library.
The goal here is to avoid locking a mutex on the "fast path" for thread
park/unpark where you're waking up a thread that isn't sleeping or otherwise
trying to park a thread that's already been notified. Mutex performance varies
quite a bit across platforms so this should provide a nice consistent speed
boost for the fast path of these functions.
@bors
Copy link
Contributor

bors commented Oct 27, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: dtolnay
Pushing 1855aff to master...

@bors bors merged commit 6511e46 into rust-lang:master Oct 27, 2017
@alexcrichton alexcrichton deleted the improve-park-unpark branch October 28, 2017 12:56
@bluss bluss added the relnotes Marks issues that should be documented in the release notes of the next release. label Nov 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants