How does C# async/await work internally?

This page summarizes the projects mentioned and recommended in the original post on /r/csharp

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • ASP.NET Core

    ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.

  • This question is the point I'm making. We don't always know what the scheduler is, even the default scheduler (setting aside that someone can make their own). Since you mentioned JavaScript, albeit sarcastically, here's a good example regarding WASM and Blazor.

  • SharpLab

    .NET language playground

  • async/await is "just" a way to write callback code after a Task is finished, in a sequential way. The await doesn't in fact wait for anything (and that's why async/await is so great). It's just a state machine, very similar to how yield works. The easiest way to find out how the magic happens is to go to sharplab.io, declare a method as async, and see what the compilator does. You'll see that the code isn't that complicated to understand (but you're happy you don't have to write it manually).

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts