parallel fx library for net 3 5 multi core programming l.
Download
Skip this Video
Download Presentation
Parallel Fx Library for .NET 3.5 & Multi-Core Programming

Loading in 2 Seconds...

play fullscreen
1 / 12

Parallel Fx Library for .NET 3.5 & Multi-Core Programming - PowerPoint PPT Presentation


  • 120 Views
  • Uploaded on

Parallel Fx Library for .NET 3.5 & Multi-Core Programming. Victor Stachura. The Man, The Myth, The Legend. Who is this guy?. Warning !. A New Programming Model is Needed. Multi-Core. Moore’s Law. Single Core. Performance. Time. Inside a Multi-Core Processor. One Processor.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Parallel Fx Library for .NET 3.5 & Multi-Core Programming' - sef


Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
the man the myth the legend
The Man, The Myth, The Legend

Who is this

guy?

Warning!

a new programming model is needed
A New Programming Model is Needed

Multi-Core

Moore’s Law

Single Core

Performance

Time

inside a multi core processor
Inside a Multi-Core Processor

One Processor

With multiple execution Cores

slide5

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

how is microsoft addressing this problem

16

1

101

PA

Parallel

Programming

How is Microsoft Addressing this Problem?

Parallel Computing Initiative

The Manycore Shift Whitepaper

the elements of parallel programming

16

1

101

PA

Parallel

Programming

The Elements of Parallel Programming

Software you need:

Parallel Fx Library

(Dec 07 CTP)

Parallel Fx Concepts:

Declarative Data Parallelism

Imperative Data Parallelism*

Imperative Task Parallelism

Namespaces:

System.Linq

System.Linq.Parallel

System.Threading

System.Threading.Tasks

.NET Framework 3.5

VS 2008

General Concepts:

Problem Identification**

Threads

Thread Safety

Locking

Synchronization

Race Conditions

Deadlock

project sybil

16

1

101

PA

Parallel

Programming

Project Sybil

So, does all this stuff work?

code sample parallel for

16

1

101

PA

Parallel

Programming

Code Sample: Parallel.For()

for (int i = 0; i < 10000000; i++)

DataArray[i] = Rand.Next();

stopWatch.Start();

for (int i = 0; i < 10000000; i++)

{

DataArray[i] = DataArray[i] / 3;

DataArray[i] = DataArray[i] * 6;

DataArray[i] = DataArray[i] / 3;

DataArray[i] = DataArray[i] * 5;

DataArray[i] = DataArray[i] / 3;

DataArray[i] *= DataArray[i];

DataArray[i] = DataArray[i] / 3;

DataArray[i] = DataArray[i] * 6;

DataArray[i] = DataArray[i] / 3;

DataArray[i] = DataArray[i] * 5;

DataArray[i] = DataArray[i] / 3;

DataArray[i] *= DataArray[i];

}

stopWatch.Stop();

for (int i = 0; i < 10000000; i++)

DataArray[i] = Rand.Next();

stopWatch.Start();

Parallel.For(0, 10000000, delegate(int i) {

DataArray[i] = DataArray[i] / 3;

DataArray[i] = DataArray[i] * 6;

DataArray[i] = DataArray[i] / 3;

DataArray[i] = DataArray[i] * 5;

DataArray[i] = DataArray[i] / 3;

DataArray[i] *= DataArray[i];

DataArray[i] = DataArray[i] / 3;

DataArray[i] = DataArray[i] * 6;

DataArray[i] = DataArray[i] / 3;

DataArray[i] = DataArray[i] * 5;

DataArray[i] = DataArray[i] / 3;

DataArray[i] *= DataArray[i];

});

stopWatch.Stop();

shift happens

16

1

101

PA

Parallel

Programming

Shift Happens

Most applications running slow

Hardware unused

Applications must change

You must learn

You are responsible

resources

16

1

101

PA

Parallel

Programming

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

ad