BackgroundWorker or Async

1

I need to develop a C # program where I will have slow processes.

I have little experience with WinForms, I have more experience with WEB development.

With the following question, does the BackgroudWorker component do the same thing as calling the function asynchronously?

If not, where should I use one and where should I use the other?

    
asked by anonymous 27.07.2016 / 13:43

1 answer

1
  

... Does BackgroudWorker do the same thing as calling the function asynchronously?

Yes, BackgroundWorker is a class that performs an operation on another thread / background . Additionally, it allows you to check information during the thread execution, cancel / interrupt the thread , typically used in Windows Form interface events.

async > programming, which in addition to supporting the features / features of BackgroundWorker allows a more readable code used in Task Parallel Library (TPL) to simplify parallelism and competition in applications.

  

... where should I use one and where should I use the other?

Unless you need to use an older version of C #, I suggest using async and await .

    
27.07.2016 / 14:28