How do Completion Port Threads of the Thread Pool behave during async I/O in .NET / .NET Core?

可紊 提交于 2019-12-06 09:38:34

Damien and Hans pointed me into the right direction in the comments, which I want to sum up in this answer.

Damien pointed to Stephen Cleary's awesome blog post which answers the first three points:

  • The async I/O operation is dispatched on the calling thread. No IOCP thread is involved.
  • Consequently, no IOCP threads block during async I/O.
  • When the result is returned to the .NET application, an IOCP thread is borrowed to mark the task complete. The continuation is queued to the target SynchronizationContext or the thread pool.

Hans pointed out that there are similar mechanisms to IOCP in Linux (epoll) and MacOS (kqueue).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!