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

use poll() to avoid 100% CPU load #14

Merged
merged 2 commits into from
Dec 6, 2021
Merged

use poll() to avoid 100% CPU load #14

merged 2 commits into from
Dec 6, 2021

Conversation

normen
Copy link
Contributor

@normen normen commented Dec 5, 2021

This PR fixes #11 by using the poll() function.

@Gadgetoid
Copy link
Owner

Wow! I didn't expect this to be quite so straight-forward. I think I'd have probably made it far more contrived if I tried implementing it. Had no idea you could just batch up a bunch of file descriptors and poll them together in a single call... I'm not much of a RTFM type 😬

Thank you!

@Gadgetoid
Copy link
Owner

(Really should remove the binary from this repo and add it manually to releases, I tried to get CI to cross-compile for RPi but it's an absolute nightmare)

@normen
Copy link
Contributor Author

normen commented Dec 5, 2021

Wow! I didn't expect this to be quite so straight-forward. I think I'd have probably made it far more contrived if I tried implementing it. Had no idea you could just batch up a bunch of file descriptors and poll them together in a single call... I'm not much of a RTFM type 😬

Thank you!

Heh, no problem. No expert here, I just RTFM 😅

(Really should remove the binary from this repo and add it manually to releases, I tried to get CI to cross-compile for RPi but it's an absolute nightmare)

Yes, the binary is small though and I committed it in case ppl would want to try it themselves. I usually don't mess with the github build server and instead use the gh command line tool to upload releases.

@Gadgetoid Gadgetoid merged commit 8b6fa68 into Gadgetoid:main Dec 6, 2021
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

Successfully merging this pull request may close these issues.

pi400kb uses 100% CPU on one core
2 participants