So far, we have used the
BackgroundWorker component and the
Thread class to execute code in independent threads. The
Thread class allows us to have great control over the thread while the
BackgroundWorker component offers a very simple way to update the UI without using complicated delegates or callbacks. How can we combine this component and this class in an application to make it faster to complete while keeping the UI responsive?
If we want to work with a
BackgroundWorker component to show some feedback or progress to the UI controls, while one or more threads created using the
Thread class is running, we must find a way to share data between threads.
We made something like that in our last example. However, we must ...