Home » Developing U++ » U++ Developers corner » BackgroundTask
Re: BackgroundTask [message #31248 is a reply to message #31245] |
Wed, 16 February 2011 16:00   |
|
mirek wrote on Wed, 16 February 2011 15:41 | 1. I would not bother with ST here. 'background' processing with timerqueue is way too different from MT IMO to try to reconcile both methods in the single class.
2. Having said that, I do not see any advantage of using BackgroundTask over using plain Thread...
|
Let me start with the second point: The advantage is that it can be compiled in ST where Thread is not defined.
The goal of this actually IS to provide single interface for both MT and ST solutions. I am aware that it doesn't solve every possible scenario, but I think there is non-trivial group of cases where this might be handy. If extended with couple of Callbacks (WhenFinished,WhenProgress,WhenStopped), it might be a good way to manage simple tasks e.g. data loading or processing.
BTW: The above code contained couple errors, they are fixed in the attachment.
-
Attachment: bgtask.cpp
(Size: 1.75KB, Downloaded 270 times)
|
|
|
Goto Forum:
Current Time: Sun Apr 27 19:39:18 CEST 2025
Total time taken to generate the page: 0.02545 seconds
|