Home » Community » U++ community news and announcements » AsyncWork
Re: AsyncWork [message #48867 is a reply to message #48864] |
Mon, 16 October 2017 10:29 |
|
mirek
Messages: 13985 Registered: November 2005
|
Ultimate Member |
|
|
koldo wrote on Mon, 16 October 2017 09:04Thank you Mirek.
(Sorry Mirek and Oblivion for an out of topic question )
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
|
|
|
|
|
AsyncWork
By: mirek on Sat, 14 October 2017 11:34
|
|
|
Re: AsyncWork
By: Oblivion on Sun, 15 October 2017 09:58
|
|
|
Re: AsyncWork
By: koldo on Sun, 15 October 2017 18:40
|
|
|
Re: AsyncWork
By: mirek on Sun, 15 October 2017 19:00
|
|
|
Re: AsyncWork
By: koldo on Mon, 16 October 2017 09:04
|
|
|
Re: AsyncWork
By: mirek on Mon, 16 October 2017 10:29
|
|
|
Re: AsyncWork
By: koldo on Tue, 17 October 2017 08:55
|
|
|
Re: AsyncWork
By: mirek on Tue, 17 October 2017 13:33
|
|
|
Re: AsyncWork
By: koldo on Wed, 18 October 2017 08:54
|
|
|
Re: AsyncWork
By: Oblivion on Mon, 16 October 2017 09:50
|
Goto Forum:
Current Time: Sun Jun 16 15:07:51 CEST 2024
Total time taken to generate the page: 0.01457 seconds
|