BackgroundWorker is a construct provided by .NET to create more manageable threads from a ThreadPool. When explaining GUI-based applications, we saw that the Main method was decorated with the STAThread attribute. This attribute guarantees control safety as controls are created in the apartment owned by the thread and cannot be shared with other threads. In Windows applications, there is the main thread of execution that owns the UI and controls, which is created when the application starts. It is responsible for accepting user inputs and painting or repainting the UI based on the actions of the user. For a great user experience, we should try to make the UI as thread-free as possible and delegate all time-consuming tasks ...
BackgroundWorker
Get Hands-On Parallel Programming with C# 8 and .NET Core 3 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.