-
Notifications
You must be signed in to change notification settings - Fork 471
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
Add select_biased! macro #1040
Add select_biased! macro #1040
Conversation
thanks for maintaining this crate. :) i'll group my gentle reminders with this single comment. but, I'd want some initial feedback for following draft prs. if there's some hope for merging them, I'll finish off these to cross the line, very happily: |
@taiki-e hey, thanks for active crossbeam maintenance. could you give this pr a initial assessment whether this pr can be merge or not ever? like other my prs, I'd like all of them to be merged eventually in some way... thanks in advance. |
Sorry for the slow response, I thought this was a patch that was 1k lines of complex implementation without any tests or documentation. I would like to merge this once the tests and documentation indicating that this is properly biased have been added, and eliminated duplicate code by something like passing a bool literal to an internal macro. |
d37a73a
to
364bda6
Compare
no problem. i really thanks for replying!
sorry for confusion... I meant this is just pre-rfc api addition with copy-paste impl by marking it as draft pr... but i lacked explicit explanation...
super cool!! I just wanted to confirm that this api addition isn't controversial as much as other prs... ;)
I've just done all the above after rebased. Also marked it as ready for review. :) Thanks in advance. |
@@ -943,6 +943,39 @@ fn fairness_send() { | |||
assert!(hits.iter().all(|x| *x >= COUNT / 4)); | |||
} | |||
|
|||
#[test] | |||
fn unfairness() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i omitted more test cases like send one. let me know if i need to add more...
macro_rules! select_biased { | ||
($($tokens:tt)*) => { | ||
{ | ||
const _IS_BIASED: bool = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this was easiest way to implement... but this is accessible to user code. however, it seems we have precedent: _LEN
.
sorry, i pushed more to fix bugs since this comment... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @ryoqun!
@taiki-e Really and really thanks for approving this pr. Then, is this pr in a kind of internal testing now before merging? Also, do i need to add entries to |
CI is failing on the master branch (mostly due to rust-lang/rust#124800) and we need to fix that before merging PRs... |
Thanks for the quick reply. hmm, that's quite unfortunate, considering this pr is so close to be shipped... I just skimmed over the rust issue and its background. That said, I wonder how soon this resolves upstream.. Maybe pinning to older nightly (nightly-2024-05-04 or earlier according to https://blog.rust-lang.org/2024/05/06/check-cfg.html) in crossbeam CI isn't a viable option? |
|
@taiki-e I'm really appreciate merging this pr (and the ci fix pr as well). seems the master branch ci is green as well. Now, the only thing I'm looking forward to is |
Published in crossbeam-channel 0.5.13. |
@taiki-e hi, I'm reporting back with a good news. :) Really thanks to your collaboration with this pr shipped, using |
(this is a draft; there's too much of code duplication...)much like rust-lang/futures-rs#1976, i want biased select in
crossbeam-channel
as well. :)