Programming with the BackgroundWorker Component in .NET 2.0
- Multithreading for Greater Productivity
- Multithreading with the .NET Framework
- Implementing the Worker Delegate
- Starting the Thread
- Reporting on Thread Progress
- Marshalling Background Threads to Foreground Threads
- Summary
Multithreading for Greater Productivity
If you’ve ever looked at your microprocessor’s performance in the Task Manager’s CPU usage history and list of processes, you might have noticed that your PC’s microprocessor’s most active task is the idle process. In fact, your CPU is most often in what we can only call the "relaxing" state. Even for developers with heavy-duty compilers, CASE tools, and UML tools, most of the computer’s hardware is underutilized; that is, software generally isn’t using most of the resources available.
One way to improve application performance and use more of your computer’s bandwidth is to add multithreading to your software. The problem historically is that many tools, such as Visual Basic 6, didn’t easily support multithreading. In general, multithreading has been the purview of only the most experienced programmers.
Not anymore.
.NET 2.0 introduces the BackgroundWorker component, which makes it easier than ever to incorporate multithreading into your applications, and I’m going to show you just how easy the component is to use.