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
The way I understand it is also, there should be a third term added to the mix: Task
.
Async
is just a qualifier you put on your method to say it's an asynchronous method.
Task
is the return of the async
function. It executes asynchronously.
You await
a Task. When code execution reaches this line, control jumps out back to caller of your surrounding original function.
If instead, you assign the return of an async
function (ie Task
) to a variable, when code execution reaches this line, it just continues past that line in the surrounding function while the Task
executes asynchronously.