When you await a result, wouldn't the main thread also be blocked until the task is completed? Isn't there just a benefit in cases where you do not await the result?
When you await a result, wouldn't the main thread also be blocked until the task is completed? Isn't there just a benefit in cases where you do not await the result?
Distraction-free reading. No ads.
Organize your knowledge with lists and highlights.
Tell your story. Find your audience.
Read member-only stories
Support writers you read most
Earn money for your writing
Listen to audio narrations
Read offline with the Medium app
I am a software developer from germany. Blogging about programming and tech related topics. I ❤️ open source and privacy.
with async/await, the thread is free to do other things instead of just sit there waiting.The main benefit is indeed when you don't await the result, such as using .Result, because the deadlock won't happen. But, there is still a benefit to always…
--