I’m using .Net 3.5 (C#) and I have a queue of tasks that I want to run one after the other, I’m doing that by using the BackgroundWorker class (with it’s DoWork, RunWorkerCompleted and IsBusy methodes and property).
1. Is it recommended to use the BackgroundWorker class if I don’t have any UI? why?
2. I heard that the BackgroundWorker class is deprecated, is it true? does anybody know why?
3. Is there another class that can help me to do what I have mentioned above?
Thanks!
P.S.
I’m running the second task just after the first one has finished.
If you don’t have any UI, do you need any sort of marshalling to another thread? If you’re running the tasks one after another, I’d just call them directly unless you need to do anything more complicated. If you know you do need to do this in a separate thread, please post more details about your requirements (including what kind of project this is).
As far as I know,
BackgroundWorkerisn’t deprecated at all. In C# 5 it will become somewhat less important due to the new async features, but it can still be used with no problems, as far as I’m aware.