O'Reilly logo

Expert One-on-One™ C# Design and Development by John Paul Mueller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 25. Creating Multithreaded Applications

Multithreading, the ability of an application to spawn several concurrent tasks, is something that many developers associate with complex applications that perform mighty deeds. However, as you'll discover in this chapter, multithreading is a technique that can benefit nearly any application when used correctly. By using multithreading correctly, you can make an application more responsive to user requests and use system resources more efficiently. In addition, you can perform tasks in the background that actually anticipate user needs — making the application appear clairvoyant.

This chapter isn't going to make you a guru on creating multithreaded applications. In fact, you'll barely see any code in this chapter. The point of this chapter is to discuss the ramifications of multithreading on your application design. The technique used to create multiple threads is well understood and documented, but the question of when and how to use multithreading is neither well known nor standardized. Many developers misuse multithreading techniques in their code because they don't fully understand the ramifications or requirements of using it to achieve a desired result.

You will see a basic multithreaded application in this chapter. The technique is actually quite simple. Of course, any simple technique can become complex under the right circumstances. Some application designs have a wealth of obscure code to control multithreaded operations. In ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required