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

Move to parking_lot::Mutex for mutex and away from std::sync::Mutex? #2496

Closed
bluejekyll opened this issue Sep 14, 2021 · 4 comments
Closed
Labels
A-lock Area: futures::lock C-feature-request

Comments

@bluejekyll
Copy link
Contributor

parking_lot has a lot of advantages over std::sync::Mutex.

Should we migrate to parking_lot for all futures_util::lock primitives?

If we're open to this, I'd be happy to contribute the work for this.

@taiki-e
Copy link
Member

taiki-e commented Sep 15, 2021

I would accept a PR to add an optional feature to do this.
(parking_lot is very good, but note that it may fail to compile on some platforms. futures needs to work on such platforms. e.g., Amanieu/parking_lot#269)

@taiki-e taiki-e added A-lock Area: futures::lock C-feature-request labels Sep 15, 2021
@lilyball
Copy link

I would love to see a parking_lot feature. I keep ending up taking code using parking_lot::Mutex and changing it to futures::lock::Mutex because it's being used in an async context, and this feels like a regression.

@ibraheemdev
Copy link
Member

Given the work going on to improve std::sync::Mutex, it might not be of much benefit to add this now.

@taiki-e
Copy link
Member

taiki-e commented Jun 5, 2022

I agreed with @ibraheemdev, and tend to close this for now.

relevant discussion: tokio-rs/tokio#4623

@taiki-e taiki-e closed this as completed Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lock Area: futures::lock C-feature-request
Projects
None yet
Development

No branches or pull requests

4 participants