1. LINQ & PLINQ (Parallel) Language Integrated Query
2. Agenda Introduction to LINQ basics Overview of advanced capabilities Demo the Basics PLINQ intro Demo of PLINQ
3. Introduction LINQ IS... A programming model that Introduces queries as a “first class” concept into .NET More leg room! Is an abstraction level for data Don’t you just love abstraction, it’s great! Is another tool for embedding SQL queries into code “This code was written by a tool” – not that kind of tool! Allows for uniform manipulation of any data type Consistently producing consistent consistency!
6. LINQ Implementations LINQ to Objects Code (Reflection), Filesin FileSystem LINQ to ADO.NET LINQ to SQL LINQ to DataSet LINQ to Entities LINQ to XML XDocument, XElement, XAttribute, XNode, etc In System.Xml.Linq.Document
12. Advanced LINQ Recursive Lambda Expressions Through the use of Fix fixed-point generator Expression Trees MSDN Blogs: Mads Torgersen - Recursive Lambda Expressions Visitor Pattern using LINQ MSDN Blogs: Jomo Fisher – Dealing with LINQs immutable expression trees
13. PLINQ Background Part of managed concurrency library in the .NET Framework Simplify concurrent processing Makes use of the Task Parallel Library (TPL) TPL in turn uses Parallel.For Parallel.ForEach Parallel.Invoke
14. Operating In Parallel Partitioning Based on computation and data type Range (Arrays, Lists) – Index into structure, equal split Not the most ideal for load balancing Striped Chunks of input Chunk level load balancing Hash Execution On available cores Merge Results Initial thread picks up results (consumer thread) ForAll, Async (pipelining), Sync (stop-and-go) PLINQ takes care of threading events, signalling, concurrency, locking, etc.