virtual techdays INDIA │ 9-11 February 2011 Parallelism in.NET 4.0 Parag Paithankar │ Technology Advisor - Web, Microsoft India
What and Why of Parallelism Threading: From There to Now Exploring The Task Parallel Library (TPL) Quick introduction Task Factories and Task Schedulers and why we need them? Diagnostics tools in Visual Studio 2010 Summary Q&A virtual techdays INDIA │ 9-11 February 2011 S E S S I O N A G E N D A
What is Parallelism? The ability to run multiple tasks in Parallel without really worrying about the underlying synchronization and management of threads Why do we need it? Computers have evolved from single core to multiple cores Software needs to take advantage of this Splitting larger jobs in smaller chunks (across cores) increasing performance and scalability together virtual techdays INDIA │ 9-11 February 2011 What and Why of Parallelism
Scenario 1: There: Threading but not Threading Windows Messaging technique Scenario 2: There: Threading for Performance Scenario 3: Now: Threading with managed synchronization ThreadPool Scenario 4: Now! Tasks across cores! Imperative Task Parallelism: System.Threading.Tasks Imperative Data Parallelism: Parallel.For, Parallel.ForEach Declarative Data Parallelism: PLINQ (AsParallel) virtual techdays INDIA │ 9-11 February 2011 Threading: From There to Now
virtual techdays INDIA │ 9-11 February 2011 Parallel Programming Architecture
Set of Public Types and APIs in System.Threading System.Threading.Tasks Enables scalability by leveraging multiple cores TPL: Handles work partitioning Thread Scheduling (ThreadPool) Cancellation support State Management virtual techdays INDIA │ 9-11 February 2011 Exploring the Task Parallel Library (TPL)
Imperative Task Parallelism Create and run tasks implicitly using Parallel.Invoke Explicitly using Tasks objects Imperative Data Parallelism Parallel.For and Parallel.ForEach loops Declarative Data Parallelism PLINQ virtual techdays INDIA │ 9-11 February 2011 Components of TPL
Task Factories Exists in Task.TaskFactory in System.Threading Creates Task Objects which can be started immediately Manage Task Waits– Task continuation Use for TPL with classic Async Programming models Task Schedulers Exists in Task.TaskScheduler in System.Threading Ensures that Tasks complete Based on ThreadPool virtual techdays INDIA │ 9-11 February 2011 Quick introduction Task Factories and Task Schedulers and why we need them?
New Windows in Debugger: Parallel Tasks Parallel Stacks virtual techdays INDIA │ 9-11 February 2011 Visual Studio 2010 support for Parallelism
virtual techdays INDIA │ 9-11 February 2011 RESOURCES Parallel Computing Resources on MSDN
virtual techdays THANKS │ 9-11 February 2011 │ blogs.msdn.com/parag