V
V
Vadim Nikiforov2021-07-08 15:31:46
.NET
Vadim Nikiforov, 2021-07-08 15:31:46

How expensive is async/await thread support?

How expensive is thread support in asynchronous programming?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-07-08
@vabka

1. async/await has nothing to do with threads
2. Depends on runtime settings and code written. Somewhere it can be almost free, somewhere expensive. Somewhere there is a lot of benefit, and somewhere there is no benefit.
3. Regarding fully synchronous code, there is a memory overhead for an asynchronous state machine + a CPU and memory overhead for machine operation.
But you do not need to allocate a whole thread to wait for IO

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question