-
Notifications
You must be signed in to change notification settings - Fork 78
features = [ "mio-support" ] causes 100% CPU usage #16
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
Comments
for another (complicated/working) example, whereby signals and new server sockets are both handled in the same On another note, since I'm just learning stuff, I've transformed the example in OP into an example that can use its own feature(s) to showcase this issue: |
When the mio-support feature is enabled, it doesn't block on .wait :-(. Reproducer for #16.
I've figured what the problem is, I still need to implement the solution. Anyway, thanks for discovering this. But, by the way, in the https://github.com/howaboutsynergy/reflo/blob/4ee633c89a984ce4a4664abf6fed1ba79bd1a041/book/l_20_1_hello/src/bin/main.rs#L83 you should be using |
When the mio-support feature is enabled, it doesn't block on .wait :-(. Reproducer for #16.
The problem was, when the feature was enabled, the wakeup socket got switched to non-blocking mode (no matter if anything mio-related was actually used). So things that should have been blocking didn't and it was retrying the read from the pipe in a tight loop. Now we don't switch to non-blocking, but use the MSG_DONTWAIT flag when we need non-blocking read. Closes #16
Thanks for telling me that Now I'm using |
cargo new somesample
Cargo.toml
:src/main.rs
:cargo run
When
features = [ "mio-support" ]
is inCargo.toml
,cargo run
will run the program and it will use 100% CPU all the time.The text was updated successfully, but these errors were encountered: