Parallel Fx Library for .NET 3.5 - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Parallel Fx Library for .NET 3.5

Description:

PA. Parallel. Programming. 101. 16. 1. Parallel Computing Initiative ... Parallel.For(0, 10000000, delegate(int i) { DataArray[i] = DataArray[i] / 3; ... – PowerPoint PPT presentation

Number of Views:91
Avg rating:3.0/5.0
Slides: 13
Provided by: rickb158
Category:
Tags: net | library | parallel

less

Transcript and Presenter's Notes

Title: Parallel Fx Library for .NET 3.5


1
Parallel Fx Library for .NET 3.5 Multi-Core
Programming
  • Victor Stachura

2
The Man, The Myth, The Legend
Who is this guy?
Warning!
3
A New Programming Model is Needed
Multi-Core
Moores Law
Single Core
Performance
Time
4
Inside a Multi-Core Processor
One Processor
With multiple execution Cores
5
Parallel Programming Makes a Difference
Task 3 Core 1
Task 4 Core 1
Parallel programming with 2 cores
Task 1
Task 5 Core 2
Task 2 Core 2
Degree of Parallel Programming
Sequential app with threads
Task 2
Task 4
Task 1
Task 3
Sequential app
Task 1
Task 2
Task 3
Task 4
Execution Time
6
How is Microsoft Addressing this Problem?
Parallel Computing Initiative
The Manycore Shift Whitepaper
7
The Elements of Parallel Programming
Software you need Parallel Fx Library (Dec 07
CTP) Parallel Fx Concepts Declarative Data
Parallelism Imperative Data Parallelism Imperativ
e Task Parallelism Namespaces System.Linq System
.Linq.Parallel System.Threading System.Threading.T
asks
.NET Framework 3.5 VS 2008
General Concepts Problem Identification
Threads Thread Safety Locking Synchronization Rac
e Conditions Deadlock
8
Project Sybil
So, does all this stuff work?
9
Code Sample Parallel.For()
for (int i 0 i lt 10000000 i)
DataArrayi Rand.Next()
stopWatch.Start() for (int i 0 i
lt 10000000 i)
DataArrayi DataArrayi / 3
DataArrayi DataArrayi 6
DataArrayi DataArrayi / 3
DataArrayi DataArrayi 5
DataArrayi DataArrayi / 3
DataArrayi DataArrayi
DataArrayi DataArrayi / 3
DataArrayi DataArrayi 6
DataArrayi DataArrayi / 3
DataArrayi DataArrayi 5
DataArrayi DataArrayi / 3
DataArrayi DataArrayi
stopWatch.Stop()
for (int i 0 i lt 10000000 i)
DataArrayi Rand.Next()
stopWatch.Start()
Parallel.For(0, 10000000, delegate(int i)
DataArrayi
DataArrayi / 3 DataArrayi
DataArrayi 6 DataArrayi
DataArrayi / 3 DataArrayi
DataArrayi 5 DataArrayi
DataArrayi / 3 DataArrayi
DataArrayi DataArrayi
DataArrayi / 3 DataArrayi
DataArrayi 6 DataArrayi
DataArrayi / 3 DataArrayi
DataArrayi 5 DataArrayi
DataArrayi / 3 DataArrayi
DataArrayi )
stopWatch.Stop()
10
Shift Happens
Most applications running slow Hardware
unused Applications must change You must
learn You are responsible
11
Resources
MS Parallel Development Center Manycore
Whitepaper Book "Multi-core programming -
Increasing Performance Through Software
Multithreading" Intel Go Videos MSDN
Article Optimized managed code for multicore
machines
12
The End
Write a Comment
User Comments (0)
About PowerShow.com