question

gsravan avatar image
0 Votes"
gsravan asked karenpayneoregon answered

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

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

dotnet-csharpdotnet-runtime
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

karenpayneoregon avatar image
0 Votes"
karenpayneoregon answered

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


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.