-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Select on newrt pipes #8008
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
Select on newrt pipes #8008
Conversation
I still haven't fully digested this, but here are a couple of observations: The commented out assertions in the comm code is worrying. It looks like all of |
Oh yeah, the trait. Probably the thing to do is to have rt::select, which exports the trait as a non-pub module to only the rest of libstd, and have std::select which exports the select function. |
I still don't see how to encapsulate this into a public select api that doesn't expose runtime internals, at least one that is generic over multiple types of selectable things. |
If I am not mistaken, as long as the If I am mistaken, we can at least do something like:
|
Regarding the suggestion of how to hide the runtime internals, I'm not comfortable with the idea of mentioning types that aren't public in the signature of other public items (and kind of think that it's a wart that Rust allows it at all). This isn't a pattern we use anywhere else, and would need some wider discussion to determine if that's ok. |
Main logic in ```Implement select() for new runtime pipes.```. The guts of the ```PortOne::try_recv()``` implementation are now split up across several functions, ```optimistic_check```, ```block_on```, and ```recv_ready```. There is one weird FIXME I left open here, in the "implement select" commit -- an assertion I couldn't get to work in the receive path, on an invariant that for some reason doesn't hold with ```SharedPort```. Still investigating this.
Wouldn't it be enough for the traits' methods to be private, and not the traits themselves? |
True, I can't really imagine it would look very friendly in the documentation, either. Seems like the |
Main logic in
Implement select() for new runtime pipes.
. The guts of thePortOne::try_recv()
implementation are now split up across several functions,optimistic_check
,block_on
, andrecv_ready
.There is one weird FIXME I left open here, in the "implement select" commit -- an assertion I couldn't get to work in the receive path, on an invariant that for some reason doesn't hold with
SharedPort
. Still investigating this.