-
Notifications
You must be signed in to change notification settings - Fork 22
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
GRPC Blocking Thread #92
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fix the file pattern to whitelist only emake and emake.exe so it stops picking up emake-tests.exe as the server. Set a timer delay larger than 0 so the server plugin stops hogging the CPU.
Use a blocking thread to poll for GRPC events and then wake up the Qt main event loop for processing them using queued connections.
…grpc-blocking-thread2
RobertBColton
force-pushed
the
grpc-blocking-thread2
branch
from
March 7, 2020 20:24
30c4a29
to
acffbad
Compare
…grpc-blocking-thread2
…grpc-blocking-thread2
…grpc-blocking-thread2
…grpc-blocking-thread2
…grpc-blocking-thread2
…grpc-blocking-thread2
…grpc-blocking-thread2
…grpc-blocking-thread2
JoshDreamland
approved these changes
Mar 25, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Alright, so the idea behind this pull request is to throw out the QTimer that was driving the GRPC plugin (and causing high CPU usage). Its existence was largely due to the poor integration GRPC has with foreign event loops which I discussed over in #89
Luckily this is something the GRPC team is working on.
grpc/grpc#14796
grpc/grpc#20194
And it's expected to land in the GRPC Core in 2-3 weeks.
grpc/grpc#14565
So this pull request replaces the timer we were using with a blocking thread that interrupts and wakes up the main GUI thread when a GRPC event comes in for the client. Rusky pushed me to do it and it is what the GRPC devs suggest as a workaround in the above issues. It uses the magic of QMetaObject to pack the event parameters up in a nice QMetaEvent which later gets delivered to
CompilerClient::UpdateLoop
where the event is free to update the GUI safely back on the main event loop.