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

High idle CPU usage #41

Closed
sp3d opened this issue Feb 12, 2016 · 2 comments
Closed

High idle CPU usage #41

sp3d opened this issue Feb 12, 2016 · 2 comments

Comments

@sp3d
Copy link

sp3d commented Feb 12, 2016

It seems coio is hard-coded to sleep at most 1ms at a time, based on line 376 of processor.rs:

thread::park_timeout(Duration::from_millis(1));

This results in much more CPU time being used than necessary, and kills battery life on mobile.

What, design-wise, is preventing threads from sleeping indefinitely until waking on an event that might give them work to do?

Edit: Upon further inspection, it seems this may be within the scope of PR #27.

@zonyitoo
Copy link
Owner

Indeed. We are working on #27 to improve this parking strategy. But currently I am busy with porting the latest context-rs to this crate, so this issue would be delayed.

If you are interest, you can create a PR for us. :)

@zonyitoo
Copy link
Owner

Close because of duplication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants