Sunday, August 16, 2015

Async await idea

In simple words .NET async await syntactic sugar helps to reduce limited resources usage.


Usually, UI thread in WPF and WinForms is the only one thread that can modify UI objects. If we use UI thread for a long-running task, the user will see freezing window. Same is relevant to ASP.NET ThreadPool, which has the limited number of threads to process requests. Async Await syntax helps to minimise usage of these resources.

If there is no need to switch back to initial context, you can continue operations on newly created thread (AsyncOperation) by using
     ConfigureAwait(false)


Recommend to watch Microsoft videos Essential Tips for Async

No comments:

Post a Comment