-
Notifications
You must be signed in to change notification settings - Fork 0
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
TUI's device thread consumes a full CPU core, even when nothing is happening #5
Comments
If we're okay pulling in another dep, this looks pretty good. |
As mentioned in a commit message: Our situation is a little weird because the downside of erring on the side of sleeping for too long isn't just lag/a decrease in responsivity for the user; instead it also means that the controller thread will consume massive amounts of CPU since it's effectively spinning waiting on the response. In the future we may want to either:
I like the latter solution. |
This is untuned and also is currently not exponential. Our situation is a little weird because the downside of erring on the side of sleeping for too long isn't just lag/a decrease in responsivity for the user; instead it also means that the controller thread will consume massive amounts of CPU since it's effectively spinning waiting on the response. So, this is a somewhat elaborate balancing act. re: #52
This is untuned and also is currently not exponential. Our situation is a little weird because the downside of erring on the side of sleeping for too long isn't just lag/a decrease in responsivity for the user; instead it also means that the controller thread will consume massive amounts of CPU since it's effectively spinning waiting on the response. So, this is a somewhat elaborate balancing act. re: #52
This happens because we constantly poll for incoming messages.
We can maintain the level of responsiveness we want while also not being extremely wasteful; it's time to implement some kind of back off on the device thread.
The text was updated successfully, but these errors were encountered: