Course · Training · Workshop

Asynchronous Programming in C#

Two intensive days of asynchronous programming for seasoned C# and .NET developers: from threads, tasks and async/await to Task Schedulers, Synchronization Contexts and ValueTasks.

In today's dynamic software landscape, mastering asynchronous programming is increasingly essential for writing faster, more modern and hardware-optimized applications. As multi-core CPUs are now standard, parallel processing is the key to unlocking performance. This comprehensive two-day course for seasoned C# and .NET developers covers a wide range of topics, from threads, tasks and async/await to advanced features like task schedulers and Synchronization Contexts. Included are plenty of hands-on exercises that enable you to master and apply the concepts of asynchronous programming. By the end of this course, you will understand how to use asynchronous techniques to optimize your applications' efficiency, scalability, and responsiveness. This course is up-to-date with .NET 9 and C# 13.

What participants say

These customers booked courses in the same topic cluster.More customers →

Content

The course covers the following topics with a strong focus on practical application and hands-on exercises:

– Introduction, Processes and Threads:

  • Synchronous vs. Asynchronous programming
  • Processes and Thread concepts
  • Thread pool
  • Worker and I/O Threads
  • When not to use the thread pool – Tasks:
  • Creating tasks
  • Returning data from a task
  • Using Tasks or Threads?
  • Waiting for tasks – Error Handling in Asynchronous Programming:
  • Exceptions in threads
  • Exceptions in tasks
  • Cancelling tasks:
    • Cancellation Token Source and Tokens
    • Continuations – Async – Await:
    • Async methods
    • Async state machine
    • The await keyword
    • Returning data from async methods
    • Async all the way
    • Async lambdas
    • Optimizing async/await
    • .GetAwaiter().GetResult()
    • WaitAsync – Task Schedulers:
  • Async Error Handling:
  • Synchronization contexts:
    • SynchronizationContext vs. TaskScheduler
  • ConfigureAwait:
    • Capturing the context: – Value Tasks:
    • Tasks vs ValueTasks
    • Performance optimizations

The course is up-to-date with .NET 9 and C# 13 and includes plenty of hands-on exercises for immediate application of learned concepts.

The actual course content may differ from the above depending on the trainer, delivery, duration and the composition of participants.

Request this course in-house

By submitting you accept our Privacy Policy.

Request a public date

No suitable public date? Register without obligation — once there is enough interest we schedule a new public date and let you know first.

Number of participants (approx.)

More than 3 participants? Best to request a dedicated in-house date directly.

By submitting you accept our Privacy Policy.

More about Asynchronous Programming in C#

Asynchronous programming in C# enables developers to create responsive and scalable applications that optimally utilize hardware resources. With modern multi-core processors, parallel processing is the key to performance optimization.

Further resources:

History

Asynchronous programming in C# evolved over several versions. The Task-based Asynchronous Pattern (TAP) was introduced in .NET Framework 4.0, followed by async/await in C# 5.0 (2012), which significantly simplified asynchronous programming.

Development was significantly driven by Stephen Toub and the .NET team at Microsoft. With .NET Core and the introduction of ValueTask, IAsyncEnumerable, and further performance optimizations, asynchronous programming was continuously improved.

Today, asynchronous programming is a fundamental component of modern .NET applications. From Web APIs to desktop applications to cloud services - async/await and the Task system enable developers to create high-performance and scalable applications. With .NET 9 and C# 13, further improvements and new features for asynchronous programming were introduced.