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

Remove the dependency on async-lock #59

Merged
merged 9 commits into from
May 14, 2024

Conversation

james7132
Copy link
Contributor

@james7132 james7132 commented Apr 21, 2024

This PR removes the need for async-lock as a dependency by making the Executor initializable in a const context. This relies on the const initialization of CondVars and Mutexes, so the MSRV was bumped to 1.68.

This MSRV bump may not be acceptable, so either this PR must wait, or an alternative queue implementation needs to be chosen.

src/lib.rs Outdated Show resolved Hide resolved
@james7132 james7132 force-pushed the remove-async-lock-dependency branch from f610163 to bffdffa Compare April 21, 2024 23:50
@james7132 james7132 requested a review from notgull April 21, 2024 23:55
Copy link
Member

@notgull notgull left a comment

Choose a reason for hiding this comment

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

As an organization we maintain an MSRV policy where the MSRV should not exceed Debian Stable's packaged version of rustc. In this case this is 1.63.0. So we need to wait before this can be merged.

@taiki-e
Copy link
Collaborator

taiki-e commented Apr 22, 2024

This relies on the const initialization of CondVars and Mutexes, so the MSRV was bumped to 1.68.

(const Mutex::new and const Condvar::new are available since 1.63. That actually requires 1.68 is const VecDeque::new)

@james7132 james7132 requested a review from notgull May 13, 2024 07:14
@james7132
Copy link
Contributor Author

Found a way to lower the MSRV to 1.63 by using Option<VecDeque<T>> instead. This shouldn't need extra branches due to the niche layout optimization of VecDeque and Option.

Copy link
Member

@notgull notgull left a comment

Choose a reason for hiding this comment

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

Thanks!

@notgull notgull merged commit a16e1d3 into smol-rs:master May 14, 2024
8 checks passed
@notgull notgull mentioned this pull request May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants