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 » Community » U++ community news and announcements » AsyncWork
Re: AsyncWork [message #48867 is a reply to message #48864] Mon, 16 October 2017 10:29 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13976
Registered: November 2005
Ultimate Member
koldo wrote on Mon, 16 October 2017 09:04
Thank you Mirek.

(Sorry Mirek and Oblivion for an out of topic question Rolling Eyes )
In your opinion, how is the best way from the Threads to interact with GUI?:
- GuiLock
- The GUI uses SetTimeCallback() to set a timer function that updates the GUI thanks to shared variables.


GuiLock is definitely better (it is a 'newer' thing too), except the cases where it cannot be used (that is where windows are created - this limitation is caused by win32 basic design, which creates 'per-thread'

SetTimeCallback is really just the 'oldest' mechanism. At that time, it was choosen as the 'safe' and straightforward way.

Also note that there is Ctrl::Call, which is 'synchronous' variant of SetTimeCallback. Basically performs the code in the main thread, but waits for its completion.

Now, practical experience: If all you want to do is to have application responsive while long operation is being performed, maybe with some fancy progress bar, all you need is GuiLock.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ide: Repository sync and repo file version history refactored
Next Topic: plugin/lz4
Goto Forum:
  


Current Time: Fri May 10 05:06:57 CEST 2024

Total time taken to generate the page: 0.01751 seconds