.NET provides many useful features and data constructs for developers who are introducing parallelism to their projects. This chapter will explore these features, including concurrent collections, the
SpinLock<T> synchronization primitive, and Parallel LINQ (PLINQ). These features can improve the performance of your applications while maintaining safe threading practices.
Most .NET developers are familiar with LINQ frameworks, including LINQ to Objects, LINQ to SQL, and LINQ to XML. There are even open source .NET LINQ libraries, such as LINQ to Twitter (https://github.com/JoeMayo/LinqToTwitter). We will take those LINQ skills and leverage them in parallel programming with PLINQ. Every LINQ developer can be a PLINQ developer after reading this chapter. Read ahead for some useful examples of working with PLINQ in C#.
In this chapter, you will learn about the following:
- Introducing PLINQ
- Converting LINQ queries...