Multiple expectations and asynchronous methods in the application

I am in the process of converting our data level for a rather large and complex WCF application for asynchronous communication with the database.

This led to the fact that async, and awaithave been placed throughout the caller / consuming code.

Looking at the stack trace for a typical query, I already see a lot of sections for System.Runtime.CompilerServices.TaskAwaiterdoing this with await. And I just started this task!

I understand what .net does when async/ is encountered await, so my question is this: are the additional overhead associated with async/ awaitwhen the result is quite a lot of asynchronous methods from the beginning of the request to the end? I understand the benefits of asynchronously invoking a database, but is there a limit? In particular, when the calling application is quite large and complex (or more appropriately large and long call stacks).

Thank.

+4
source share

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


All Articles