Tag Archives: async/await

Using C# async/await, Task.WhenAny, Task.WhenAll to improve and throttle performance

Introduction

Recently I read a great blog post by Jeremy Lindsay about using async/await and Task.WhenAll to improve performance of C# code. It is something that every .Net developer should know and add to their tool belt when it comes to executing multiple tasks in parallel. It can dramatically boost application performance and reduce app run time. The cool thing is the async/await/Task related threading apis are easy to understand, use and implement.

In this blog post I want to build on top of what Jeremy shared, and talk about how we can use a combination of async/await, Task.WhenAny, Task.WhenAll to not only improve performance, but also throttle it based on max number of tasks/threads you want to have running in parallel.

Continue reading Using C# async/await, Task.WhenAny, Task.WhenAll to improve and throttle performance