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

share vtable between waker and waker ref #2045

Merged
merged 2 commits into from
Jan 6, 2020
Merged

share vtable between waker and waker ref #2045

merged 2 commits into from
Jan 6, 2020

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Jan 4, 2020

The Waker::will_wake compares both a data pointer and a vtable to
decide if wakers are equivalent. To avoid false negatives during
comparison, use the same vtable for a waker stored in WakerRef.

The `Waker::will_wake` compares both a data pointer and a vtable to
decide if wakers are equivalent. To avoid false negatives during
comparison, use the same vtable for a waker stored in `WakerRef`.
@Matthias247
Copy link
Contributor

I think this is the right thing to do, according to our discussion in rust-lang/rust#66281

Although it obviously looks "not that correct" on the first glance.

Have you by chance run any of the benchmarks and seen a speedup?

Copy link
Member

@carllerche carllerche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this happen 👍

@carllerche carllerche merged commit 5930ace into tokio-rs:master Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants