Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » howto best Ctrl Refresh handling w/ MT & very frequent refreshes
Re: howto best Ctrl Refresh handling w/ MT & very frequent refreshes [message #27035 is a reply to message #27019] Tue, 22 June 2010 11:24 Go to previous messageGo to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
thanks for the example.

i indeed could see performance wins applying the overall approach. so together with the example, we could consider this problem to be solved to a satisfactory degree.

i just try to sum up the things we learned here:

PROBLEM:
frequent, independant refreshes to a lot of Ctrl's (deep in tree or not) caused by different threads than the Main thread produce a high CPU load, becaause the Ctrl's are indeed refreshed one by one (or at least almost). additionally, the threads passing the refresh work over to the MainThread (using ICall interface etc.) are beeing slept for that time. -> main thread invokes Refresh just too often, because the Updates (that trigger the Refresh) are independant.

SOLUTION:
separate the data Update (SetData, SetText, SetLabel, etc) of the Ctrl's from the natural / automatic triggering of Refresh() (inside Ctrl's, unaccessible), by:

* using a cached class like the above (if you only use Get/SetData). it overloads the Get/SetData() and prevents the triggering of Refresh each time..

* (more complex) providing a caching database independant of Get/SetData() (or other Interface functions ).

both solutions conclude with a periodic Refresh() call for all (meanwhile) affected/changed Ctrl's. Refresh time does not need to be faster than 200 ms.

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: GtkWidget inside U++
Next Topic: DONE: ColumnList with Ctrl's
Goto Forum:
  


Current Time: Wed May 08 01:06:58 CEST 2024

Total time taken to generate the page: 0.03086 seconds