I have a method like this:
private async Task DoSomething()
{
// long running work here.
}
When I call the method like this it blocks t
async
methods begin their execution synchronously. async
is useful for composing asynchronous operations, but it does not magically make code run on another thread unless you tell it to.
You can use Task.Run
to schedule CPU-bound work to a threadpool thread.
See my async / await intro post or the async FAQ for more information.