What is the behavior of ConfigureAwait (false) inside ASP.NET?

I am trying to understand the behavior ConfigureAwait(false)in ASP.NET. In particular, if I am not the awaitresult. An example of what I mean:

var result = DoSomethingAsync().ConfigureAwait(false);

// do some things other things here. Is our task executing simultaneously?

await result;

From what I read, in the context of ASP.NET (not the kernel), I understand that:

  • ConfigureAwait(false)will prevent context re-creation when returning to the application stream. If not specified, the context can be restored to another stream in the original.
  • ConfigureAwait(false)will use the default thread pool scheduler and AspNetSynchronizationContextwill no longer be used.
  • In ASP.NET (not the kernel) AspNetSynchronizationContext, it ensures that all tasks will be executed sequentially (not in parallel), but each task can be executed in a different thread.
  • , ASP.NET, . -.

, , , , ? , , . , ASP.NET, ?

, ? AspNetSynchronizationContext ConfigureAwait(false), ?

UPDATE:

"" . , " ". , , . . . ASP.NET . https://msdn.microsoft.com/en-us/magazine/gg598924.aspx

, ConfigureAwait (false) ASP.NET ( ), ( ) ?

- ?

2:

:

ASP.NET Classic ConfigureAwait (false) ?

+4
1

ConfigureAwait DoSomethingAsync().

var result = DoSomethingAsync().ConfigureAwait(false);

// do some things other things here. Is our task executing simultaneously?

await result;

var result = DoSomethingAsync();

// do some things other things here. Is our task executing simultaneously?

await result.ConfigureAwait(false);

. ConfigureAwait await.

.ConfigureAwait(true), , , , - await.

+4

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


All Articles