Async and Parallel Programming: Application Design
Discusses the design of asynchronous and parallel applications using the new Task-based model available in .NET 4 and Silverlight 5.
Authored by:
Dr. Joe Hummel
Duration: 3h 45m
Level: Intermediate
Released: 5/29/2012
Features:
Duration: 3h 45m
Level: Intermediate
Released: 5/29/2012
Features:
Course Rating:
You are currently not signed in. Please sign in to access subscriber-only content.
Currently using: {{getCurrentPlayerName()}} [Change]
| expand all | collapse all | Progress | Duration | |
|---|---|---|---|
Understanding the Dangers of Concurrency |
|
01:23:11 | |
|
Introductions and Agenda
|
|
01:52 | |
|
The pitfalls of concurrency
|
|
01:50 | |
|
Correctness guarantees: safety, liveness
|
|
00:44 | |
|
Terminology: race conditions, critical sections
|
|
00:54 | |
|
Race conditions involving shared resources
|
|
03:36 | |
|
Demo 1: parallelizing a Logfile Search app
|
|
01:14 | |
|
Demo 1: source code layout
|
|
04:26 | |
|
Demo 1: from sequential to parallel
|
|
11:41 | |
|
Demo 1: summary of why it's broken
|
|
00:18 | |
|
Solving race conditions --- an overview
|
|
01:00 | |
|
Solution 1: locking
|
|
03:57 | |
|
Demo 2: solution using locking
|
|
03:56 | |
|
Solution 2: interlocking
|
|
01:14 | |
|
Demo 3: solution using interlocking
|
|
07:53 | |
|
Solution 3: lock-free
|
|
02:14 | |
|
Demo 4: lock-free solution
|
|
13:35 | |
|
The danger of shared objects
|
|
01:55 | |
|
Thread-safety and solutions to shared objects
|
|
02:54 | |
|
Demo 5: using thread-safe objects
|
|
04:14 | |
|
Synchronization primitives
|
|
01:07 | |
|
The concurrent data structures: thread-safe collections
|
|
00:22 | |
|
Performance lessons...
|
|
02:21 | |
|
Demo 6: improving performance
|
|
08:31 | |
|
Summary and References
|
|
01:23 | |
Execution Model and Types of Parallelism |
|
01:04:19 | |
|
Introductions and Agenda
|
|
01:59 | |
|
Tasks: developer's role vs. .NEt's role
|
|
00:24 | |
|
Execution model: high-level view
|
|
01:29 | |
|
Task granularity: just how lightweight?
|
|
00:58 | |
|
Execution model: tasks vs. threads vs. cores
|
|
02:33 | |
|
Custom task scheduling
|
|
00:53 | |
|
Additional observations regarding task scheduler
|
|
01:35 | |
|
Work-stealing in detail
|
|
01:52 | |
|
Two important assumptions: short-lived, random order
|
|
00:50 | |
|
Fairness option to execute tasks in order
|
|
01:22 | |
|
LongRunning option for tasks > 1-2 seconds
|
|
00:45 | |
|
Demo 1: executing 100 long-running tasks
|
|
00:30 | |
|
Demo 1: solution attempt with default behavior
|
|
04:26 | |
|
Demo 1: solution attempt with long-running option
|
|
02:08 | |
|
Solution for 100 long-running tasks
|
|
01:47 | |
|
Demo 2: proper solution in action
|
|
04:32 | |
|
Parallel.For = more concise solution
|
|
00:44 | |
|
Types of Parallelism
|
|
00:36 | |
|
Data parallelism
|
|
00:52 | |
|
Task parallelism
|
|
00:37 | |
|
Dataflow parallelism
|
|
02:24 | |
|
Embarrassingly parallel
|
|
00:57 | |
|
TPL support for parallelism types
|
|
00:25 | |
|
Parallel.For, .Foreach, .Invoke
|
|
02:44 | |
|
Structured (fork-join) parallelism
|
|
01:07 | |
|
Demo 3: Mandelbrot app overview
|
|
01:11 | |
|
Demo 3: sequential version
|
|
01:57 | |
|
Demo 3: Parallel.For version
|
|
06:38 | |
|
Data partitioning
|
|
02:15 | |
|
Custom data partitioning
|
|
02:28 | |
|
Exception handling with Parallel class
|
|
00:41 | |
|
Breaking out of a Parallel loop
|
|
01:26 | |
|
Cancelling a Parallel loop
|
|
01:40 | |
|
Demo 4: Mandelbrot app with cancellation
|
|
05:50 | |
|
Summary and References
|
|
01:44 | |
Designs and Patterns for Parallel Programming |
|
01:17:32 | |
|
Introductions and Agenda
|
|
01:35 | |
|
Design Problem 1: 100+ CPU-intensive operations
|
|
02:25 | |
|
Design Problem 2: download 20+ web pages
|
|
03:14 | |
|
Design Problem 3: application logging task
|
|
02:09 | |
|
Parallel Patterns --- master list
|
|
00:28 | |
|
Pipeline pattern
|
|
01:29 | |
|
Dataflow pattern
|
|
01:34 | |
|
Increasing parallelism in pipeline and dataflow
|
|
01:16 | |
|
Concurrent Data Structures --- master list
|
|
00:59 | |
|
ConcurrentQueue T
|
|
03:31 | |
|
Demo 1: overview of Netflix data mining app
|
|
03:24 | |
|
Demo 1: overview of parallel solution (v1)
|
|
02:44 | |
|
Demo 1: implementation with ConcurrentDictionary T
|
|
05:43 | |
|
Demo 1: results
|
|
01:14 | |
|
Producer-Consumer pattern
|
|
01:23 | |
|
Implementation of Producer-Consumer with BlockingCollection T
|
|
03:03 | |
|
Demo 2: Netflix solution using Producer-Consumer (v2)
|
|
07:40 | |
|
Demo 2: results
|
|
00:52 | |
|
MapReduce pattern
|
|
00:51 | |
|
Implementing MapReduce
|
|
04:24 | |
|
Demo 3: Netflix using MapReduce
|
|
03:50 | |
|
Demo 3: results
|
|
01:33 | |
|
Parallel LINQ (PLINQ)
|
|
02:46 | |
|
Demo 4: Netflix with PLINQ
|
|
03:08 | |
|
Speculative Execution pattern
|
|
01:25 | |
|
APM: Asynchronous Programming Model pattern
|
|
01:23 | |
|
APM example of async file I/O
|
|
01:17 | |
|
Demo 5: Stock History with Speculative Execution and APM
|
|
09:01 | |
|
Parallel I/O design challenge
|
|
01:45 | |
|
Summary and References
|
|
01:26 |
Understanding the Dangers of Concurrency