+ All Categories
Home > Documents > The Free Lunch is Over

The Free Lunch is Over

Date post: 22-Feb-2016
Category:
Upload: urban
View: 44 times
Download: 0 times
Share this document with a friend
Description:
The Free Lunch is Over. Getting good at Parallel with .NET 4.0. [email protected]. www.thejoyofcode.com. @ joshtwist. But first…. You could have been at the PDC!. An apology …. The Free Lunch is Over. - PowerPoint PPT Presentation
Popular Tags:
19
The Free Lunch is Over Getting good at Parallel with .NET 4.0 www.thejoyofcode. com @joshtwist jtwist@microsoft. com
Transcript
Page 1: The Free Lunch is Over

The Free Lunch is Over

Getting good at Parallel with .NET 4.0

www.thejoyofcode.com@joshtwist

[email protected]

Page 2: The Free Lunch is Over

But first…• An apology…

You could

have been

at the PDC!

Page 3: The Free Lunch is Over

The Free Lunch is OverPublished in March 2005

…the big theme of the 2004 In-Stat/MDR Fall

Processor Forum was multicore devices, as many

companies showed new or updated multicore

processors. Looking back, it’s not much of a

stretch to call 2004 the year of multicore.

http://www.gotw.ca/publications/concurrency-ddj.htm

Page 4: The Free Lunch is Over

10,000,000

1,000,000

100,000

10,000

1,000

100

10

1

01970 1975 1980 1985 1990 1995 2000 2005 2010

Moore’s Law

Clock Speed (MHz)

Transistors (000s)

Page 5: The Free Lunch is Over

The free lunch ended in 2005; why am I still eating?

Web ServersMany concurrent

requests

Batch ProcessingVirtualisation

DesktopsLow Hanging Fruit

Many Processes To Run

Page 6: The Free Lunch is Over

But soon…

PFX team in Redmond – 128

cores!Our labs – 24 coresNew desktops – 8

cores Me – 2 cores

Page 7: The Free Lunch is Over

The Free Lunch is Over

Concurrency is the next major revolution in how

we write software…

… The vast majority of programmers today don’t

grok concurrency, just as the vast majority of

programmers 15 years ago didn’t yet grok objects

http://www.gotw.ca/publications/concurrency-ddj.htm

Page 8: The Free Lunch is Over

Why? Tools for concurrency before .Net 4

• APM (Asynchronous Programming Model)• EAP (Event-based Asynchronous Programming)• new Thread()• ThreadPool & QueueUserWorkItem• Sync Primitives: ResetEvents,

Semaphores, WaitHandles, Monitors, Slims etc.

• ThreadStatic & CallContext

Page 9: The Free Lunch is Over

Two challenges

1. Logically rethink the processing in your application to support concurrency – tough!

2. Rewrite the application using these basic primitives – tough!

Page 10: The Free Lunch is Over

In .Net 4• Parallel Extensions– Tasks– Parallel – PLINQ– ThreadLocal / Lazy– Visual Studio 2010 Concurrency

Debugging Support

Page 11: The Free Lunch is Over

Two primary types

Task Parallelism Data Parallelism

Page 12: The Free Lunch is Over

Task Parallelism

New Credit Application

Store Request

Validate Address

Get Credit References

Get Internal Credit Data

Decide!

Page 13: The Free Lunch is Over

DEMONSTRATIONTask Parallelism

Page 14: The Free Lunch is Over

Two primary types

Data Parallelism

Page 15: The Free Lunch is Over

DEMONSTRATIONData Parallelism

Page 16: The Free Lunch is Over

Some things not covered• BlockingCollections and Pipelines• FromSynchronizationContext• Visual Studio Debugging Tools• and much more…

Page 17: The Free Lunch is Over

Q&A• 1. Your questions?

• 2. My go!

Page 18: The Free Lunch is Over

My questions• Who uses WF (Workflow)?• Version 4?• Those who don’t – why not?• Those who do…–What are your impressions?– Any feedback?

Page 19: The Free Lunch is Over

Thank you!

www.thejoyofcode.com@joshtwist

[email protected]

Want help from people like me? Ask about PSfD.

Questions also accepted by

Twitter. Follow me or else.


Recommended