Learn Parallel Programming with C# and .NET
4.3 (1,536 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
10,692 students enrolled

Learn Parallel Programming with C# and .NET

Discover the core multithreading and parallelization concepts supported by the .NET framework.
Bestseller
4.3 (1,536 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
10,692 students enrolled
Created by Dmitri Nesteruk
Last updated 11/2019
English
English [Auto-generated], Indonesian [Auto-generated], 5 more
  • Italian [Auto-generated]
  • Polish [Auto-generated]
  • Portuguese [Auto-generated]
  • Romanian [Auto-generated]
  • Thai [Auto-generated]
Current price: $34.99 Original price: $49.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 5.5 hours on-demand video
  • 1 article
  • 30 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Create and run independent tasks
  • Manage synchronized access to data
  • Effectively use parallel collections
  • Work with task continuations
  • Write parallel loops
  • Leverage the power of Parallel LINQ
  • Master asynchronous programming (async/await)
Course content
Expand all 54 lectures 05:18:18
+ Course Introduction
1 lecture 02:37

Some information about the course author, what the course contains, how the material is presented and what you need to know before taking part in the course.

Preview 02:37
+ Task Programming
7 lectures 46:26

An overview of all the lectures in this section.

Overview
00:49

An introduction to the Task abstraction, with examples of how to create and start tasks.

Preview 10:11

A look at .NET's special CancellationTokenSource and CancellationToken classes that are used to cooperatively cancel running tasks.

Cancelling Tasks
11:50

If you're inside a task and want to wait a while, there are ways to do this besides Thread.Sleep().

Waiting for Time to Pass
04:32

How to wait on a single task or, indeed, a set of tasks.

Waiting for Tasks
06:51

If an exception is thrown inside a Task, who catches it, and how?

Exception Handling
05:25

A summary of key concepts from this section's lectures.

Summary
06:48
+ Data Sharing and Synchronization
7 lectures 50:44

An overview of the lectures in this section.

Overview
03:10

The lock keyword and what it means.

Critical Sections
06:31

Atomic operations on primitive values.

Interlocked Operations
04:45

A lock that doesn't yield.

Spin Locking and Lock Recursion
09:30

One of the key WaitHandle-based synchronization structures.

Mutex
12:11

A look at reader-writer locks, including upgradeability and recursion support.

Reader-Writer Locks
09:56

A summary of the lectures in this section.

Summary
04:41
+ Concurrent Collections
7 lectures 41:10

An overview of lectures in this section.

Overview
01:11

A thread-safe dictionary.

ConcurrentDictionary
14:08

A thread-safe queue.

ConcurrentQueue
02:54

A thread-safe stack.

ConcurrentStack
04:01

A collection which is similar, in principle, to a thread-safe List except it doesn't preserve the order. Thus it's called a Bag.

ConcurrentBag
05:46

BlockingCollection is a special wrapper around the producer-consumer collection that is capable of blocking the producer thread until a value is available, and is capable of exposing a 'consuming enumerable' that blocks the consumer until there's an item for it to consume.

BlockingCollection and the Producer-Consumer Pattern
11:22

A summary of materials from the lectures in this section.

Summary
01:48
+ Task Coordination
8 lectures 46:05

An overview of lectures in this section.

Overview
01:27

Different forms of continuations exist.

Continuations
05:29

Child tasks are tasks whose lifetime are joined to those of the parent.

Child Tasks
06:17

A useful sync primitive for coordinating multi-phase algorithms.

Barrier
09:22

A simple sync primitive with a counting-down value.

CountdownEvent
05:29

Ordinary signals which, depending on whether they are set or not, block or unblock a thread.

ManualResetEventSlim and AutoResetEvent
07:03

A complicated sync data structure which allows increasing/decreasing a counter to control how many threads can be executing at the same time.

SemaphoreSlim
05:22

A summary of materials from the lectures in this section.

Summary
05:36
+ Parallel Loops
6 lectures 37:48

An overview of lectures in this section.

Overview
01:19

Parallel loops... what could be simpler?

Parallel Invoke/For/ForEach
08:25

Learn to break out of or cancel parallel loops, and what happens if an exception is thrown.

Breaking, Cancellations and Exceptions
09:41

Concurrent access from all tasks on each iteration to a variable is very inefficient. Why not access it once per task, and keep a task-local store of intermediate results that incurs no sync overhead?

Thread Local Storage
06:54

Creating a delegate on each Task invocation is inefficient, but if we tell .NET how we want to partition data, we may end up with a much faster method.

Partitioning
07:45

A summary of materials from the lectures in this section.

Summary
03:44
+ Parallel LINQ
6 lectures 27:01

An overview of lectures in this section.

Overview
01:40

AsParallel() turns an IEnumerable<T> into a ParallelQuery<T>

AsParallel and ParallelQuery
08:55

Just like with Task and Parallel.Xxx, PLINQ takes cancellation tokens and throws either AggregateException or OperationCancelledException.

Cancellation and Exceptions
06:24

How quickly do you want your data? Or should PLINQ cluster results together and return them in batches?

Merge Options
04:20

LINQ Aggregate() function has a special PLINQ overload.

Custom Aggregation
04:26
Summary
01:16
+ Asynchronous Programming (Async/Await)
10 lectures 01:04:10

A detailed description of async/await mechanics.

Overview
14:04

A look at async/await in action... in a WinForms app.

Using Async and Await
10:58

Behind the scenes, async methods get their associated state machines.

State Machines
04:06

Learn what Task.Run is used for.

Task.Run
06:00

Learn about Task.WhenAny/WhenAll.

Task Utility Combinators
01:48

C# doesn't have async constructors (yet), but factory methods are the next best thing.

Async Factory Method
05:01

A generalized way of indicating that your classes require asynchronous initialization.

Asynchronous Initialization Pattern
04:46

We all love Lazy<T>, but can it play nice with async methods?

Asynchronous Lazy Initialization
05:51

A brand new class introduced in .NET Core, ValueTask is a lightweight alternative to Task.

ValueTask
10:18

A summary of all the things we've learned in this section of the course.

Summary
01:18
+ Course Summary
2 lectures 02:17

A summary of materials from the lectures in this section.

Course Summary
02:04

Links to my other courses.

Bonus Lecture: Other Courses at a Discount
00:13
Requirements
  • Basic knowledge of C# and .NET framework
  • Basic knowledge of multithreading
Description

This course is about .NET Parallel Programming with C# and covers the core multithreading facilities in the .NET Framework, namely the Task Parallel Library (TPL) and Parallel LINQ (PLINQ).

This course will teach you about:

  • Task Programming: how to create and run tasks, cancel them, wait on them and handle exceptions that occur in tasks.

  • Data Sharing and Synchronization, ensuring your access to shared data also happens in a safe and consistent manner.

  • Concurrent Collections, such as ConcurrentBag, which operate correctly even when accessed from multiple threads.

  • Task Coordination concepts, including the idea of continuations, as well as uses of synchronization primitives to coordinate tasks.

  • Parallel Loops which let you easily iterate over a counter or collection while partitioning the data and processing it on separate threads.

  • Parallel LINQ, the parallel version of .NET's awesome Language-Integrated Query (LINQ) technology.

  • Async/Await and .NET's support for asynchronous programming.

This course is suitable for:

  • Beginner and experienced .NET/C# developers

  • Anyone interested in multi-threading, parallelism and asynchronous programming

The course consists of the following materials:

  • Video lectures showing hands-on programming

  • C# files that you can download and run

Before taking the course, you should be comfortable with the C# programming language and familiar with multi-threading.

Who this course is for:
  • Beginner and experienced .NET developers
  • Computer Science students
  • Anyone interested in modern approaches to multithreading/parallelism