|
|
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 #26772 is a reply to message #26771] |
Wed, 26 May 2010 18:43 |
|
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
thanks guys for replys.
the app is kind of an audio devices monitoring tool with meterbridges data coming in as push data (i dont have control over time when it comes in). it should display kind of fluidly, 200 ms is alright, but if you imagine 25+ devices firing thir live data, that comes in at random time in different threads, there it's the mess.
Quote: |
It makes no sense to update the widget and spend system resources on it, more often than it is able to notice the eyes.
|
i'd need even 1/20 = 50 ms refreshtime..so 200ms is a compromise already
as far as i know GUI "is" MT safe, as long as you use GuiLock __; scope helper in the other threads to modify the gui.. internally it maps some stuff to Main Thread and waits for it anyway. but not everythin in GUI is MT, like DnD stuff etc.. dig in the CtrlCore win32 code, and you will find some ASSERT(IsMainThread).
Quote: |
ParentCtrl which keeps cached image and drws it upon refresh
|
this would increase memory consumptiion for rather huge ctrl's, but is an option. but what about all the small ctrls already present? it would be a lot of work to adjust them
Quote: |
GuiLock works in similar way like PostCallback?!
|
no, not quite the same. PostCallback gets executen in the same TimerThread, while the GuiLock is only a mutex to aquire GUI use rights for your own different thread (!= main)
Quote: |
little bit to just change the GUI without refresh and then call refresh from main thread periodically.
|
this was my intention, but i dnot know of any means in Ctrl to update a Ctrl (using its API, SetData() etc) without causing an internal Refresh(). setting data to controls always results in an Refresh(), unlike i.e. setting Ctrl properties like maybe font, color, min max etc..this needs a manual Refresh() as far as i know. this all is by design. Ctrls distinguish in their between "parametrising" a Ctrl (setting it up) which does *not* trigger a Refresh() automatically, and "using, providing actual data" to Ctrl, which automatically Triggers a Refresh().
Now I am "using" my Ctrls, so they refresh that frequently..
it would be great to "postpone" the Refresh() of a Ctrl for later.. but donno how to do it, or if the Ctrl API already supports it
|
|
|
Goto Forum:
Current Time: Tue May 07 17:52:41 CEST 2024
Total time taken to generate the page: 0.02446 seconds
|
|
|