You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The trouble with this is that while it cuts down CPU usage, it adds a perceptible delay to any GUI event handling. I managed to tweak it to a sweet spot of 10000 microseconds to get an acceptable GUI event responsiveness as well as felling CPU to 1%.
However, I reckon that perhaps there is a more elegant way to do this? Any suggestions?
The text was updated successfully, but these errors were encountered:
Using the example found in
_example/twitterstream
, my GUI loop in the main thread is setup as shown below:This lets me use the
uiLock
mutex to safely make changes to the GUI in other goroutines, and this works well.However, doing this basically jacks up the CPU usage of this process due the rather busy loop in which
gtk.MainIterationDo(false)
is called.My first shot at reducing the CPU usage was to add a
time.Sleep
:The trouble with this is that while it cuts down CPU usage, it adds a perceptible delay to any GUI event handling. I managed to tweak it to a sweet spot of 10000 microseconds to get an acceptable GUI event responsiveness as well as felling CPU to 1%.
However, I reckon that perhaps there is a more elegant way to do this? Any suggestions?
The text was updated successfully, but these errors were encountered: