Chapter 16. Multithreading Patterns


Chapter 15 focused on managing threads and synchronizing the data that the threads share. As developers write more multithreaded code, a common set of scenarios and programming patterns for handling those scenarios emerges. The key scenarios relate to notifications of when a thread completes and notifications about the progress on the threads status. In addition, there is some built-in C# functionality for calling methods asynchronously, regardless of whether their signatures match THReadStart. Most importantly, going with built-in patterns like this significantly reduces the effort in programming to solve these types of scenarios from scratch.

The two patterns specifically designed for these scenarios are the asynchronous results pattern and the background worker pattern, and this chapter investigates both. This chapter breaks down how to code these patterns into a step-by-step process, and it points out some important characteristics of Windows Forms programming.




Essential C# 2.0
Essential C# 2.0
ISBN: 0321150775
EAN: 2147483647
Year: 2007
Pages: 185

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