parallel programming and f#
DESCRIPTION
Best of PDC08, parallel programming and F# introductionsTRANSCRIPT
![Page 1: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/1.jpg)
Lynn Langit – Developer Evangelisthttp://blogs.msdn.com/SoCalDevGal
Daniel Moth - Parallel Computing Platformhttp://www.danielmoth.com/Blog
Luca Bolognesehttp://blogs.msdn.com/lucabol/
![Page 2: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/2.jpg)
Parallel Pattern Library
Resource Manager
Task Scheduler
Task Parallel Library
PLINQ
Managed Library Native Library
ThreadsThreadsOperating System
Concurrency Runtime
Programming Models
AgentsLibrary
ThreadPool
Task SchedulerTask Scheduler
Resource ManagerResource Manager
Data Structures
Dat
a St
ruct
ures
Integrated Tooling
Tools
ParallelDebugger
Toolwindows
Profiler Concurrency
Analysis
Programming Models
Concurrency Runtime
![Page 3: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/3.jpg)
![Page 4: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/4.jpg)
![Page 5: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/5.jpg)
Program Thread
Program Thread
CLR Thread Pool
GlobalQueue
Worker Thread 1
Worker Thread p
![Page 6: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/6.jpg)
CLR Thread Pool: Work-Stealing
Worker Thread 1
Worker Thread p
Program Thread
Program Thread
GlobalQueue
LocalQueue
LocalQueue
Task 1Task 1Task 2Task 2
Task 3Task 3Task 5Task 5Task 4Task 4
Task 6Task 6
![Page 7: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/7.jpg)
![Page 8: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/8.jpg)
ThreadPoolThreadPoolThreadPool.QueueUserWorkItem(…);
System.Threading.Tasks
Task.StartNew(…);Starting
var p = Task.StartNew(() => { var t = Task.StartNew(…);});
Parent/Child
var f = Future.StartNew(() => C());…int result = f.Value;
Tasks with resultsTask t = Task.StartNew(…);
Task p = t.ContinueWith(…);t.Wait(2000);t.Cancel();
Continue/Wait/Cancel
![Page 9: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/9.jpg)
![Page 10: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/10.jpg)
![Page 11: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/11.jpg)
![Page 12: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/12.jpg)
![Page 13: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/13.jpg)
var q = from p in people where p.Name == queryInfo.Name && p.State == queryInfo.State && p.Year >= yearStart && p.Year <= yearEnd orderby p.Year ascending select p;
![Page 14: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/14.jpg)
![Page 15: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/15.jpg)
Area Descriptions Example Scenarios
Imperative Data Parallelism
Apply the same operation to common collections/sets in parallel. Looping, data partitioning, reductions, scans, etc.
Medical imagingBond pricing
Task Parallelism Simultaneously perform multiple independent operations. Divide-and-conquer, tasks, threads, fork/join, futures, etc.
Process control automation
Shared Resources Building blocks for implementing concurrent components. Scalable and thread-safe collections, locks, etc.
Middle-tier configuration/state management
Declarative Data Parallelism
Define what computation needs to be done, without the how. Selections, filters, joins, aggregations, groupings, etc.
Statistical modeling
Coordination Exploit latent operations by doing work while waiting for data. Asynch I/O, async interaction points, message passing, etc.
Streaming audio
Task Parallel LibraryTask Parallel LibraryParallel Pattern LibraryParallel Pattern LibraryOpenMP, Cluster SOAOpenMP, Cluster SOA
Coordination Data StructuresCoordination Data StructuresTransactional MemoryTransactional Memory
MPI, MPI.net, CCRMPI, MPI.net, CCRNative Agents and MessagingNative Agents and Messaging
MaestroMaestro
PLINQPLINQ
![Page 16: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/16.jpg)
www.microsoftpdc.comhttp://msdn.com/concurrency
Visual Studio 2010 &Visual Studio 2010 & Framework 4.0Framework 4.0
![Page 17: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/17.jpg)
all PDC sessionsOverview - why and how parallelismPLINQ screencastOther Ch9 PLINQ screencastsPLINQ MSDN articleMSDN concurrencyVS 2010 on Ch9VS 2010 weekParallel Computing - VisionDaniel Moth blog
![Page 18: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/18.jpg)
•Fewer side effects•More opportunities for parallelism•Used for advanced computation, math, data mining, financial•More concise, fewer bugs
![Page 19: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/19.jpg)
![Page 20: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/20.jpg)
• Improvements to the F# research release
April 2008 Microsoft Research
refresh release
• Broadly improved VS 2008 integration• Simplifications in language and libraries
Just ReleasedSeptember 2008
CTP
• Full product-quality release• Fully stable and supported language• Aligned with future VS releases
2009Supported Release
![Page 21: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/21.jpg)
F# tutorials
F# MSDN Developer Center
F# for Windows Azure
F# Samples
Expert F# book and code samples
![Page 22: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/22.jpg)
• On the Web:• http://fsharp.net
• Books:
![Page 23: Parallel Programming and F#](https://reader034.vdocuments.us/reader034/viewer/2022052618/554f882eb4c905435d8b4ce1/html5/thumbnails/23.jpg)
Thanks vets!