Parallel Programming and F#


Published on

Best of PDC08, parallel programming and F# introductions

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • 06/06/09 06:24 © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  • Parallel Programming and F#

    1. 1. Lynn Langit – Developer Evangelist Daniel Moth - Parallel Computing Platform Luca Bolognese
    2. 2. Threads Operating System Concurrency Runtime Programming Models Task Scheduler Resource Manager Integrated Tooling Programming Models Concurrency Runtime Parallel Pattern Library Resource Manager Task Scheduler Task Parallel Library PLINQ Managed Library Native Library Agents Library ThreadPool Data Structures Data Structures Tools Parallel Debugger Toolwindows Profiler Concurrency Analysis
    3. 5. Program Thread CLR Thread Pool Global Queue Worker Thread 1 Worker Thread p
    4. 6. Program Thread Task 1 Task 2 Task 3 Task 5 Task 4 Task 6 CLR Thread Pool: Work-Stealing Worker Thread 1 Worker Thread p Global Queue Local Queue Local Queue
    5. 8. ThreadPool ThreadPool .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 results Task t = Task .StartNew(…); Task p = t.ContinueWith(…); t.Wait(2000); t.Cancel(); Continue/Wait/Cancel
    6. 13. 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;
    7. 15. Area Descriptions Example Scenarios Imperative Data Parallelism Apply the same operation to common collections/sets in parallel. Looping, data partitioning, reductions, scans, etc. Medical imaging Bond pricing Task Parallelism Simultaneously perform multiple independent operations. Divide-and-conquer, tasks, threads, fork/join, futures, etc. Process control automation Shared Resources <ul><ul><li>Building blocks for implementing concurrent components. Scalable and thread-safe collections, locks, etc. </li></ul></ul>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 <ul><ul><li>Exploit latent operations by doing work while waiting for data. Asynch I/O, async interaction points, message passing, etc. </li></ul></ul>Streaming audio Task Parallel Library Parallel Pattern Library OpenMP, Cluster SOA Coordination Data Structures Transactional Memory MPI,, CCR Native Agents and Messaging Maestro PLINQ
    8. 16. <ul><ul><li> </li></ul></ul>Visual Studio 2010 & Framework 4.0
    9. 17. all PDC sessions Overview - why and how parallelism PLINQ screencast Other Ch9 PLINQ screencasts PLINQ MSDN article MSDN concurrency VS 2010 on Ch9 VS 2010 week Parallel Computing - Vision Daniel Moth blog
    10. 18. <ul><li>Fewer side effects </li></ul><ul><li>More opportunities for parallelism </li></ul><ul><li>Used for advanced computation, math, data mining, financial </li></ul><ul><li>More concise, fewer bugs </li></ul>
    11. 20. <ul><ul><li>Improvements to the F# research release </li></ul></ul>April 2008 Microsoft Research refresh release <ul><ul><li>Broadly improved VS 2008 integration </li></ul></ul><ul><ul><li>Simplifications in language and libraries </li></ul></ul>Just Released September 2008 CTP <ul><ul><li>Full product-quality release </li></ul></ul><ul><ul><li>Fully stable and supported language </li></ul></ul><ul><ul><li>Aligned with future VS releases </li></ul></ul>2009 Supported Release
    12. 21. F# tutorials F# MSDN Developer Center F# for Windows Azure F# Samples Expert F# book and code samples
    13. 22. <ul><li>On the Web: </li></ul><ul><ul><li> </li></ul></ul><ul><li>Books: </li></ul>
    14. 23. Thanks vets!