Home » Community » U++ community news and announcements » AsyncWork
Re: AsyncWork [message #48866 is a reply to message #48860] |
Mon, 16 October 2017 09:50  |
Oblivion
Messages: 1226 Registered: August 2007
|
Senior Contributor |
|
|
Quote:Dear Mirek, dear Oblivion
For a standard GUI program to have a more responsive user interface, do you propose AsynWork to launch all jobs?
(And of course, sorry for this reference, to forget forever any Ctrl::ProcessEvents() call Sad ).
Hello Koldo,
I agree with Mirek.
You should use dedicated Thread(s) (in contrast to worker threads).
While AsyncWork, hence CoWork, does a decent job here (considering that it has cancellation feature and -"experimental"- pipe support), disadvantages of thread pools in general comes into play in such scenarios.
I don't want to go into details here, so just to keep it short:
You'll usually have no control over the states and priorites of workers, or exact execution time, or sometimes, if the job will be executed in worker threads at all. Therefore building a UI on AsyncWork, or thread pools in general, is not a very good idea. UI or any other time consuming operation can easily take advantage of it, but IMO it should not be built upon it.
(See the new SSH package, for a concrete -experimental- example of AsyncWork, and how it makes things simpler (and faster, up to 2-4 times).)
P.s. But there is a middle ground if you really need something like that. An attempt build a hybrid of worker thread concept, and dedicated threads, with a reasonble control over the given thread's states and priority: Job (the one I wrote). You may also want to try that.
Best regards,
Oblivion.
Github page: https://github.com/ismail-yilmaz
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Mon, 16 October 2017 13:26] Report message to a moderator
|
|
|
 |
|
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 Aug 24 15:13:41 CEST 2025
Total time taken to generate the page: 0.04940 seconds
|