Backgroundworker or Async

Asked

Viewed 77 times

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.

I am with the following doubt, the Backgroudworker component does the same thing as calling the function asynchronously?

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

  • It depends. What you mean by "calling the function asynchronously"?

  • guy a topical good that explains what you want :)

1 answer

1


...Backgroudworker does the same thing as calling the function asynchronously?

Yes, Backgroundworker is a class that performs an operation on another thread/background. It also allows you to check information during the execution of thread, cancel/interrupt the thread, normally used in Windows Form interface events.

From . Net Framework 4.5 support was included for async Programming, that in addition to supporting the characteristics/Features Backgroundworker allows a more readable code, used in Task Parallel Library (TPL) to simplify parallelism and competition in applications.

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

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.