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 call-backs. How can we combine this component and this class in an application to make it faster to complete while being responsive?
If we want to work with a BackgroundWorker component to show some feedback or progress to the UI controls, while one or more thread 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. But we must use some techniques ...