170 likes | 392 Views
FT20. F# for Parallel and Asynchronous Programming. Luke Hoban F# Program Manager Microsoft Corporation. F#: Productive, Functional, Scalable. demo . Luke Hoban F# Program Manager Microsoft. Parallel Computing and PDC09. Tools. Managed Languages. Visual F#. Axum. Visual Studio 2010.
E N D
FT20 F# for Parallel and Asynchronous Programming Luke Hoban F# Program Manager Microsoft Corporation
F#: Productive, Functional, Scalable demo Luke Hoban F# Program Manager Microsoft
Parallel Computing and PDC09 Tools Managed Languages Visual F# Axum Visual Studio 2010 Parallel Debugger Windows Native Libraries Managed Libraries DryadLINQ Async AgentsLibrary Parallel Pattern Library • Profiler Concurrency • Analysis Parallel LINQ Rx Task ParallelLibrary Data Structures Data Structures Microsoft Research Native Concurrency Runtime Task Scheduler Race Detection Managed Concurrency Runtime Resource Manager ThreadPool Fuzzing Operating System HPC Server Threads UMS Threads Windows 7 / Server 2008 R2 Research / Incubation Visual Studio 2010 / .NET 4 Operating System Key:
Shared State Four Big Concurrency Challenges • Inversion of Control • I/O Parallelism • Scaling to multi-machine
Shared State Concurrency Challenges • Inversion of Control • Difficult to maintain and test • Very difficult to parallelize! • Locking is fundamentally error prone: • Must guess where parallelism will be needed • All consumers need to participate • I/O Parallelism • Scaling to Multi-Machine
F#: Immutability and Functional Programming demo Luke Hoban F# Program Manager Microsoft
Shared State Concurrency Challenges • Inversion of Control • We’re used to writing code linearly • Async requires decoupling Begin from End • Very difficult to • Combine multiple asynchronous operations • Deal with exceptions and cancellation • I/O Parallelism • Scaling to Multi-Machine
Shared State Concurrency Challenges • Inversion of Control • I/O Parallelism • Software is often I/O-bound • Leveraging web services • Working with data on disk • Network and disk speeds increasing slower • I/O resources are inherently parallel • Huge opportunity for performance • Scaling to Multi-Machine
F#: async { … } demo Luke Hoban F# Program Manager Microsoft
Shared State Concurrency Challenges • Inversion of Control • I/O Parallelism • To scale up, must to go beyond a single machine • Multi-machine resources becoming common • Roll-you-own clusters with cheap hardware • On-demand cloud compute with Azure • But • Shared memory doesn’t scale • Scaling to Multi-Machine
F#: Agents and Azure demo Luke Hoban F# Program Manager Microsoft
Shared State • immutability Recap: Some Concurrency Challenges • Inversion of Control • async { … } • I/O Parallelism • async { … } • Scaling to Multi-Machine • agents
YOUR FEEDBACK IS IMPORTANT TO US! Please fill out session evaluation forms online at MicrosoftPDC.com
Learn More On Channel 9 • Expand your PDC experience through Channel 9 • Explore videos, hands-on labs, sample code and demos through the new Channel 9 training courses channel9.msdn.com/learn Built by Developers for Developers….