System.Threading.Tasks Task Represents an asynchronous operation Supports waiting, cancellation, continuations, … Parent/child relationships 1 st -class.

Slides:



Advertisements
Similar presentations
Luis Guerrero UX Software Arquitect Plain Concepts
Advertisements

Introduction Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit TexPoint fonts used in EMF. Read the TexPoint manual.
Hazim Shafi Principal Architect Microsoft Corporation TL19.
Parallel Performance Tools in Visual Studio 2010.
ISO 9126: Software Quality Internal Quality: Maintainability
The Brave New World of Software Adam Kemp Staff Software Engineer National Instruments.
James Kolpack, InRAD LLC popcyclical.com. CodeStock is proudly partnered with: Send instant feedback on this session via Twitter: Send a direct message.
Parallel Extensions to the.NET Framework Daniel Moth Microsoft
Concurrency The need for speed. Why concurrency? Moore’s law: 1. The number of components on a chip doubles about every 18 months 2. The speed of computation.
 Niklas Gustafsson Software Architect Microsoft Corporation TL22.
Overview of.NET Framework Sanjay Vyas. Whats New In Base Class Library Declaration & consumption of extensibility points Monitoring for new runtime extension.
Stephen Toub Parallel Computing Platform Microsoft Corporation.
Virtual techdays INDIA │ 9-11 February 2011 Parallelism in.NET 4.0 Parag Paithankar │ Technology Advisor - Web, Microsoft India.
Parallel Programming in Visual Studio 2010 Sasha Goldshtein Senior Consultant, Sela Group
Daniel Moth  Parallel Computing Platform Microsoft Corporation TL26.
Alex Becker.  Multi-core is short for “multiple cores”  Advances in technology allow for several discrete cores on one chip  This however is not multi-CPU.
CMSC 611: Advanced Computer Architecture Performance Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted.
Connect with life Bijoy Singhal Developer Evangelist | Microsoft India.
Steve Teixeira Principal Product Unit Manager Parallel Developer Tools Microsoft Corporation.
CPU Performance Assessment As-Bahiya Abu-Samra *Moore’s Law *Clock Speed *Instruction Execution Rate - MIPS - MFLOPS *SPEC Speed Metric *Amdahl’s.
Parallel Programming in.NET Kevin Luty.  History of Parallelism  Benefits of Parallel Programming and Designs  What to Consider  Defining Types of.
A Top Level Overview of Parallelism from Microsoft's Point of View in 15 minutes IDC HPC User’s Forum April 2010 David Rich Director Strategic Business.
Phil Pennington Sr. Developer Evangelist Microsoft Corporation SESSION CODE: WSV325.
 Lynne Hill General Manager Parallel Computing Platform Visual Studio.
Programming Paradigms for Concurrency Part 2: Transactional Memories Vasu Singh
Vance Morrison Performance Architect Microsoft Corporation.
Multi-core Programming Introduction Topics. Topics General Ideas Moore’s Law Amdahl's Law Processes and Threads Concurrency vs. Parallelism.
Lecture 1: Performance EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer Engineering Spring 2013, Dr. Rozier.
Parallel Extensions A glimpse into the parallel universe By Eric De Carufel Microsoft.NET Solution Architect at Orckestra
Parallel Extensions A glimpse into the parallel universe Eric De Carufel
Parallel Programming: Responsiveness vs. Performance Joe Hummel, PhD Microsoft MVP Visual C++ Technical Staff: Pluralsight, LLC Professor: U. of Illinois,
About Me Microsoft MVP Intel Blogger TechEd Israel, TechEd Europe Expert C++ Book
Lecture 21 Parallel Programming Richard Gesick. Parallel Computing Parallel computing is a form of computation in which many operations are carried out.
Outline  Over view  Design  Performance  Advantages and disadvantages  Examples  Conclusion  Bibliography.
Parallel Processing Sharing the load. Inside a Processor Chip in Package Circuits Primarily Crystalline Silicon 1 mm – 25 mm on a side 100 million to.
Parallel Extensions A glimpse into the parallel universe By Eric De Carufel Microsoft.NET Solution Architect at Orckestra
Barry Wimlett Technical Specialist BSc MBCS blackmarble.com.
Lecture 20: Parallelism & Concurrency CS 62 Spring 2013 Kim Bruce & Kevin Coogan CS 62 Spring 2013 Kim Bruce & Kevin Coogan Some slides based on those.
Multi-Core Development Kyle Anderson. Overview History Pollack’s Law Moore’s Law CPU GPU OpenCL CUDA Parallelism.
Huseyin YILDIZ Software Design Engineer Microsoft Corporation SESSION CODE: DEV314.
1 Programming Environment and Tools VS.Net 2012 First project MSDN Library.
IAsyncResult ar = BeginSomething(…); // Do other work, checking ar.IsCompleted int result = EndSomething(ar);
1)Leverage raw computational power of GPU  Magnitude performance gains possible.
Module 8 Enhancing User Interface Responsiveness.
Parallel Pattern Library Resource Manager Task Scheduler Task Parallel Library Task Parallel Library Parallel LINQ Managed Native Key: Threads Operating.
Data Parallelism Task Parallel Library (TPL) The use of lambdas Map-Reduce Pattern FEN 20141UCN Teknologi/act2learn.
Stephen Toub Senior Program Manager Lead Microsoft Session Code: DTL203.
Visual Studio 2010 and.NET Framework 4 Training Workshop.
Lecture 27 Multiprocessor Scheduling. Last lecture: VMM Two old problems: CPU virtualization and memory virtualization I/O virtualization Today Issues.
Concurrency and Performance Based on slides by Henri Casanova.
1/46 PARALLEL SOFTWARE ( SECTION 2.4). 2/46 The burden is on software From now on… In shared memory programs: Start a single process and fork threads.
Concurrency (Threads) Threads allow you to do tasks in parallel. In an unthreaded program, you code is executed procedurally from start to finish. In a.
Hardware Trends CSE451 Andrew Whitaker. Motivation Hardware moves quickly OS code tends to stick around for a while “System building” extends way beyond.
Hardware Trends CSE451 Andrew Whitaker. Motivation Hardware moves quickly OS code tends to stick around for a while “System building” extends way beyond.
TOPICS WHAT YOU’LL LEAVE WITH WHO WILL BENEFIT FROM THIS TALK.NET developers: familiar with parallel programming support in Visual Studio 2010 and.NET.
Tuning Threaded Code with Intel® Parallel Amplifier.
Linux Kernel Development Chapter 8. Kernel Synchronization Introduction Geum-Seo Koo Fri. Operating System Lab.
Lighting Up Windows Server 2008 R2 Using the ConcRT on UMS
Processing Framework Sytse van Geldermalsen
Multicore Hardware and Software Engineering
C++ Forever: Interactive Applications in the Age of Manycore
Parallel Processing Sharing the load.
F# for Parallel and Asynchronous Programming
Erlang Multicore support
By Brandon, Ben, and Lee Parallel Computing.
Patterns for Programming Shared Memory
Multithreading Why & How.
Lecture 20 Parallel Programming CSE /27/2019.
Lecture 20 Parallel Programming CSE /8/2019.
More concurrency issues
Presentation transcript:

System.Threading.Tasks Task Represents an asynchronous operation Supports waiting, cancellation, continuations, … Parent/child relationships 1 st -class debugging support in Visual Studio 2010 Task : Task Tasks that return results Task Exceptions Task Scheduler

In the year 2003, CPU performance growth had hit a wall. Up until then, most of us wrote sequential code and relayed on the CPU frequency to consistently raise (in 12 years it climbed from 400Hz to 3.8GHz) while futilely counting on Moore law (that the number of transistors on a chip will double about every two years) to keep on translating into faster processorsMoore law

More than 1 billion transistors in 2006! More than 1 billion transistors in 2006! The number of transistors doubles every two years…

The number of transistors on Intel’s chips never stopped climbing, even after the year However, clock speed stopped on 2003 somewhere near 3GHz.

Frequencies will NOT get much faster! Maybe 5 to 10% every year or so, a few more times… And these modest gains would make the chips A LOT hotter!

IEnumerable drivers =...; var results = new List (); foreach(var driver in drivers) { if (driver.Name == queryName && driver.Wins.Count >= queryWinCount) { results.Add(driver); } results.Sort((b1, b2) => b1.Age.CompareTo(b2.Age));

IEnumerable drivers = …; var results = new List (); int partitionsCount = Environment.ProcessorCount; int remainingCount = partitionsCount; var enumerator = drivers.GetEnumerator(); try { using (var done = new ManualResetEvent(false)) { for(int i = 0; i < partitionsCount; i++) { ThreadPool.QueueUserWorkItem(delegate { while(true) { RaceCarDriver driver; lock (enumerator) { if (!enumerator.MoveNext()) break; driver = enumerator.Current; } if (driver.Name == queryName && driver.Wins.Count >= queryWinCount) { lock(results) results.Add(driver); } if (Interlocked.Decrement(ref remainingCount) == 0) done.Set(); }); } done.WaitOne(); results.Sort((b1, b2) => b1.Age.CompareTo(b2.Age)); } finally { if (enumerator is IDisposable) ((IDisposable)enumerator).Dispose(); }

Global Queue Program Thread Worker Thread 1 Item 1 Item 2 Item 3 Item 4 Item 5 Item 6

Program Thread Lock-Free Global Queue Lock-Free Global Queue Local Work- Stealing Queue Local Work- Stealing Queue Local Work- Stealing Queue Worker Thread 1 Worker Thread p Task 1 Task 2 Task 3 Task 5 Task 4 Task 6

Parallel Pattern Library Resource Manager Task Scheduler Task Parallel Library Task Parallel Library Parallel LINQ Managed Native Key: Threads Operating System Concurrency Runtime Programming Models ThreadPool Task Scheduler Resource Manager Data Structures Tools Tooling Parallel Debugger Tool Windows Parallel Debugger Tool Windows Profiler Concurrency Analysis Profiler Concurrency Analysis Agents Library UMS Threads.NET Framework 4 Visual C++ 10 Visual Studio IDE Visual Studio IDE Windows

Theoretical maximum speedup determined by amount of sequential code