-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Timers need to work in 1:1 mode #10925
Comments
repurposing this for just timers, signals will be deferred to a new issue. |
See #11203 for signals. |
How about adding blocking receive with a timeout to channels and using |
I agree that if channels had timeout functionality built in that much of this might not be necessary, but I personally do not know how to do this efficiently. For now though, this should probably be discussed in a separate issue. I would still like to have an API with timers as channels, and if we can later upgrade the implementation to use receive with timeouts that's great, but we don't have the ability to do that right now. |
@alexcrichton: There's already a condition variable on native channels as far as I know, so the natural way to expose this functionality is a Exposing the natural, high-level API makes a lot more sense to me than exposing the lowest common denominator between native and green tasks as they are implemented at the moment. It won't require much implementation work to expose something else, if you don't try to make it faster for green threads than the current timer API. |
add lint [`incorrect_clone_impl_on_copy_type`] Split off from rust-lang#10788. Closes rust-lang#10700 ---- changelog: new lint [`incorrect_clone_impl_on_copy_type`] [rust-lang#10925](rust-lang/rust-clippy#10925)
Right now they're heavily based on channels in M:N mode, and this does not easily work at all in 1:1 mode. These abstractions either need to be completely redesigned in order to support being able to work in 1:1 and M:N mode, or they need to get a reasonable implementation in 1:1 mode.
The current best idea that I have for this is to have a global "worker thread" which is an "event loop" for timers and signals. Also remember that whatever design is settled on must have a solution for all platforms.
The text was updated successfully, but these errors were encountered: