How do async methods use stack?

Viewed 487

I just started to use .NET async programming and everyone tells that it's better for server-side code because if I use async keywork ASP.NET won't create threads for every request and will reuse the same threads for all async code.

Because every thread needs stack and there may be hundreds of threads, it allows the opportunity to save huge amount of memory, e.g:

regular: 1500 threads x 2mb = 3000 mb
async:   20 threads x 2mb   =   40 mb

But does it mean that async code is executing without stack? Or where is it stored and how does .NET use it?

3 Answers
Related