Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I gather that the async methods are good for IO work because they don't block the thread whilst they're being awaited, but how is this actually possible? I assume something has to be listening to trigger the task to complete, so does this mean that the blocking is just moved somewhere else?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
362 views
Welcome To Ask or Share your Answers For Others

1 Answer

No, the blocking is not moved anywhere else. BCL methods that return awaitable types use techniques such as overlapped I/O with I/O completion ports for a fully asynchronous experience.

I have a recent blog post that describes how this works all the way down to the physical device and back.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...