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

Do not poll on the port in recv_timeout #9195

Closed
flaper87 opened this issue Sep 14, 2013 · 4 comments
Closed

Do not poll on the port in recv_timeout #9195

flaper87 opened this issue Sep 14, 2013 · 4 comments

Comments

@flaper87
Copy link
Contributor

Current implementation causes a wakeup every time it checks for new messages, which is very bad for the battery life among other things.

IRC Chat: https://botbot.me/mozilla/rust/msg/6023259/

@olsonjeffery
Copy link
Contributor

tl;dr if we had #6842 this would be a non-issue.

@olsonjeffery
Copy link
Contributor

so i dug in a bit and it looks like, maybe, #6842 is actually resolved? (there is std::select which punts the trait defintion to std::rt::select .. so I guess we would want to impl Select or whatever on uvio::UvTimer

@brson confirm/deny?

@alexcrichton
Copy link
Member

I'm of the opinion that we shouldn't implement this polling strategy in the libraries at all. Without a short-term fix I don't think that this should be merged at all.

Polling is generally agreed upon as the wrong strategy, and I don't think that it's ok to expose these as core synchronization library functions when they will perform differently than you'd expect.

@alexcrichton
Copy link
Member

Closing because #9194 wasn't merged.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jul 28, 2022
…rcho

unused_self: respect avoid-breaking-exported-api

```
changelog: [`unused_self`]: Now respects the `avoid-breaking-exported-api` config option
```

Fixes rust-lang#9195.

I mostly copied the implementation from `unnecessary_wraps`, since I don't have much understanding of rustc internals.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants