What does default ConfigureAwait do? ASP.NET Web API 2

I am working on an ASP.NET Web API 2 Application. In the application, we use for each asynchronous request:

ConfigureAwait(false);

I can’t understand what this means. I looked on the Internet, but still do not understand what exactly is he doing?

+4
source share
1 answer

To understand this, you need to understand what the Synchronization Context and Threading Model are .

. (Win Forms WPF). . UI .

ConfigureAwait async/await. ,

await DoAsync();
//UI updating code goes here. Will run on UI thread

, ConfigureAwait (false)

await DoAsync().ConfigureAwait(false);
//CPU intensive operation. Will run on thread pool

, ASP.NET. . SynchronizationContext ASP.NET .

+4

Source: https://habr.com/ru/post/1683957/


All Articles