C# async/await: how main thread knows that awaited function is completed and can resume the work ?

sravan kumar 121 Reputation points
2021-04-04T19:41:56.217+00:00

Hi,

I'm trying to deep dive into the concept of async programming and need some help in understanding the same.

what I know : When control hits await func, it gives the execution work to pool thread and main thread gets free.

Query : how main thread knows that pool thread completed the async task ? is that main thread keeps checking the worker thread if task completed or not ?

note: i believe, pool thread / worker thread / background thread all are same.

Thanks,
Sravan kumar

Developer technologies | .NET | .NET Runtime
Developer technologies | C#
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Karen Payne MVP 35,586 Reputation points Volunteer Moderator
    2021-04-04T19:51:59.813+00:00

    There is no one straightforward answer and with that would defer you to this article.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.