Realdolmen Education

Details

Async Programming in .NET

This course is currently not scheduled on the open calendar, but can be organized on request.

Request Course

Duration

1 day(s)

Audience

Developers

Prerequisites

C#, some notions of multithreading

Objectives

Learn to use the Task Parallel Library & the new async/await keywords to simplify your multithreaded code or offload long-running instructions across multiple CPU’s/cores.

Methods

Instructor-led with exercises

Description

The course starts by covering all important aspects of parallel tasking: why is this important & how can we achieve this?We’ll learn about starting tasks in parallel, waiting for tasks, composing tasks, working with nested & child tasks, working with exceptions & working with cancellation.

After that, we’ll (shortly) go into parallel extensions & PLINQ.Once these principles are known, we can now venture into the async/await keywords: what are they used for, how are they linked to TPL, and when should you (or shouldn’t you) use them?

Contents

  • Introduction
    • Concepts
    • Threads to Tasks
  • TPL
    • TaskScheduler
    • Waiting
    • Continuing
    • The SynchronizationContext
    • Nested & Child Tasks
    • Composing Tasks
    • Exceptions
    • Cancelling Tasks
  • Data Parallelism
    • Loops & breaking loops
    • Cancelling loops
    • PLINQ
  • Async & await
    • A misconception
    • From Task syntax to async/await syntax
    • Dispatching
    • Cancellation
    • Composition
    • Exceptions
    • Re-entrancy