110 likes | 194 Views
INDIA │ 9-11 February 2011. virtual techdays. Parallelism in .NET 4.0. Parag Paithankar │ Technology Advisor - Web , Microsoft India. INDIA │ 9-11 February 2011. virtual techdays. What and Why of Parallelism Threading: From There to Now Exploring The Task Parallel Library (TPL)
E N D
INDIA │ 9-11 February2011 virtual techdays Parallelism in .NET 4.0 Parag Paithankar│ Technology Advisor - Web, Microsoft India
INDIA │ 9-11 February2011 virtual techdays • 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 S E S S I O N A G E N D A
INDIA │ 9-11 February2011 virtual techdays • 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 What and Why of Parallelism
INDIA │ 9-11 February2011 virtual techdays • 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) Threading: From There to Now
INDIA │ 9-11 February2011 virtual techdays Parallel Programming Architecture
INDIA │ 9-11 February2011 virtual techdays • 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 Exploring the Task Parallel Library (TPL)
INDIA │ 9-11 February2011 virtual techdays • 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 Components of TPL
INDIA │ 9-11 February2011 virtual techdays • 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 Quick introduction Task Factories and Task Schedulers and why we need them?
INDIA │ 9-11 February2011 virtual techdays • New Windows in Debugger: • Parallel Tasks • Parallel Stacks Visual Studio 2010 support for Parallelism
INDIA │ 9-11 February2011 virtual techdays • Parallel Computing Resources on MSDN • http://msdn.microsoft.com/en-us/concurrency/default RESOURCES
THANKS│ 9-11 February2011 virtual techdays paragp@microsoft.com │ blogs.msdn.com/parag