From my understanding one of the main things that async and await do is to make code easy to write and read - but is using them equal to spawning background threads to perfo
Tasks let you control the number of threads you are running on.
The optimal number of threads is the number of cores you have.
when your app is Console, WinForms or WPF then you are normally running on a single-thread.
Task.Run()
, and sometimes Parallel.ForERach()
when your app runs on a Webserver it normally is running on (too) many threads.
asp.net waits for incoming requests and quickly hands each one to a new pool thread.
await
asynchrous I/O