-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Switch back to std::sync::Mutex? #4623
Comments
Tokio's use of However, I agree that it would be interesting to measure performance with |
Oops, I thought parking_lot was the default. Either way, if std faster I think parking_lot should just be removed entirely. |
The parking_lot mutex has a |
Dang, though that stuff should be able to be deprecated as std is moving towards removing the allocation that prevents things from being const: rust-lang/rust#93740 |
Removing the feature flag is a breaking change. It could be made into a no-op, where enabling it doesn't actually do anything and Tokio unconditionally would use the |
How does deprecation work? Would the idea be to say the flag is deprecated (AFAIK there's no way to mark a flag as deprecated) and then remove it in a major release? I think it's perfectly reasonable to make it a noop (I would even argue removal is fine without a major release) because parking_lot is specifically documented as an "internal feature." Unless there's a policy about internal features I'm missing? |
Futexes are a Linux-only thing, remember. |
There isn't any way to mark a feature flag itself as deprecated, but it could be made to emit a deprecation warning by enabling code that emits a deprecation warning. An otherwise unused type can be added and marked as deprecated to emit a deprecation warning when the feature is enabled. Alternatively, a build script could check if the "deprecated" feature is enabled, and emit a warning using Both of these solutions are kind of hacky though. |
Personally I see no reason to get rid of this feature. |
Yeah, IMO, the only compelling reason to remove the feature is to actually get rid of the need to test another feature combination, which we can't do without a breaking change anyway, so it's not going to happen any time soon. Users can always just choose not to enable |
rust-lang/rust#97791 should make std's |
That's nice to know. Increasing our MSRV to 1.63.0 isn't going to happen anytime soon, but it probably will eventually. |
Meanwhile, does it make sense to move |
So for now that would be a breaking change due to const and MSRV. Once that change happens, I'd still say its a breaking change. |
Once this happens, can |
|
Unfortunately they can't since with |
rust-lang/rust#95035
std is using futex now and seems to beat parking lot in most cases. Are there contention benchmarks that could validate this for tokio?
The text was updated successfully, but these errors were encountered: