Threading in VB.NET
A few people have been asking me how to build threading into their applications to improve the applications responsiveness and/or perceived performance. Rather then rehash what’s already been well written about, here’s a few articles that I suggest reading:
Ted Pattison has done a series of articles on the subject for the Basic Instincts column in MSDN Magazine.
- Implementing Callback Notifications Using Delegates (Part 1)
- Implementing Callback Notifications Using Delegates (Part 2)
- Asynchronous Method Execution Using Delegates
- Updating the UI from a Secondary Thread
- Creating and Managing Secondary Threads
- Thread Synchronization
Ken Getz has also written a follow-up of sorts to Ted’s article series, but that article is not available via MSDN yet. If you are interested in seeing that article right now, you’d have to go pick up a copy of the March 2005 issue of MSDN Magazine. If you don’t have a subscription to this magazine, what’s wrong with you? ;-)
Carl Franklin has also done an example of a component that works with the designers that utilizes threading and shows how to communicate between the worker thread and the UI thread. He has yet another example illustrating the value of thread synchronization. I recommend checking both of these out as well.
Doug Thews has a recent article in Visual Studio Magazine (albeit in C#) that contains even more information (from another perspective) on threading in .NET. If there’s any interest, I could finish converting the rest of the code to VB (I’ve already converted the ProgressBar example for a friend). Just let me know and I’ll make it available for download.
UPDATE: Found another example available on GotDotNet by MDolan.