Chapter 3. Multithreaded Programming

I l @ ve RuBoard

The ability to perform multiple simultaneous tasks is often a critical feature for more sophisticated applications. The Microsoft .NET Framework's threading libraries finally give developers who use Microsoft Visual Basic the freedom to create fully threaded applications. Entire portions of an application can be executed asynchronously, allowing for more efficient designs and more responsive user interaction.

Most introductory Visual Basic .NET books touch on the subject of .NET threading, but they seldom go beyond the simplest of examples. A large amount of information about threading is never included in most practical texts . I'll attempt to address threading concepts at a deeper level. I should state up front, however, that a single chapter can never serve as a comprehensive treatise on a topic such as this. Our discussion will focus on a number of advanced threading concepts without embroiling the reader in nitty-gritty technical details that would be of little use to the more casual reader. In other words, this chapter will provide an introduction to more advanced topics from a practical perspective and at the same time provide some guidance on when, where, and how to use threads in your applications.

Threads can allow you to create sophisticated applications, but not without a cost. More threads do not always mean better performance, and how the threading is implemented will affect your performance and resource usage (either positively or negatively). In this chapter, I'll outline critical methods for implementing threading and other threading- related features and demonstrate how best to use them in your applications. I'll also highlight some practices that are best avoided.

I'll assume that you have at least a passing familiarity with the fundamentals of the technologies under discussion. You should know what threads are and how to create "simple" threads in Visual Basic .NET. But because of the conceptual complexity of threading issues, we'll start with an overview of basic threading concepts and then progress to concepts such as synchronization constructs. I'll provide examples to demonstrate useful techniques and thread usage, which you can build on in your own projects.

I l @ ve RuBoard


Designing Enterprise Applications with Microsoft Visual Basic .NET
Designing Enterprise Applications with Microsoft Visual Basic .NET (Pro-Developer)
ISBN: 073561721X
EAN: 2147483647
Year: 2002
Pages: 103

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net