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 WinFroms is only one thread that can update UI controls. If we use UI thread for long running task then user will see freezing window. Same is relevant to ASPNet ThreadPool, which has 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