Member-only story

Another set of common async / Task pitfalls, and how to avoid them

Stefan Schranz
6 min readMay 2, 2021

--

It was nice to see how many people took the time to read my first story on this subject (https://itnext.io/common-async-task-mistakes-and-how-to-avoid-them-fe61e2c587f), so I decided I’ll just follow up with another set of these gotchas.

Tasks start hot

Probably most of the readers are aware of the fact that an async method starts hot. But just for recap, let’s see this code:

That was not a big surprise. Now let’s see the code using the hot start of a Task:

--

--

Stefan Schranz
Stefan Schranz

Written by Stefan Schranz

26 year old full stack software developer from Germany - Enthusiatic about C#, .Net and Cloud — Visit me at https://dotschranz.net/

No responses yet

Write a response