5

In his blog post on thread use in C# async/await (http://blog.stephencleary.com/2013/11/there-is-no-thread.html) Stephen Cleary details how there's no thread being used to process a truly async operation, like file I/O, web request etc. (other than time borrowed from existing threads such as I/O threads)

From that post it seems that the BCL will use either Overlapped I/O or I/O Completion Ports to pass the operation to the OS when the OS is Windows.

My question is does the same 'threadless' and non-blocking model of async operations apply on implementations of C# for other OSs, chiefly Mono for Linux?

If so what's the channel the BCL uses to communicate with the OS, since it would seem IOCP (and overlapped I/O) are specific to the Win32 API?

Additionally, presumably, once it reaches the driver the operation is async irrespective of OS?

Underscore
  • 1,017
  • 2
  • 10
  • 26
  • https://stackoverflow.com/questions/13407542/is-there-really-no-asynchronous-block-i-o-on-linux At least Linux has async operation API like `io_uring` that "is kernel backed and DOESN'T use a userspace thread pool", so Mono or .NET Core can wrap that up to implement async/await. – Lex Li Nov 27 '21 at 06:40

0 Answers0