In general, asynchronous I/O methods do not use separate threads. I explain this in detail in my blog post There Is No Thread.
However, in this specific case, that's not quite true. WebRequest
-based APIs in .NET have supported asynchronous operations for a long time, but have actually always done HTTP proxy detection and DNS lookup as synchronous, even through their asynchronous APIs. This was noticed when HttpClient
started becoming popular. Unfortunately, Microsoft decided not to fix these long-standing bugs.
So, HttpClient
wraps its WebRequest
calls in a thread pool thread. Note that it is still using the "asynchronous" APIs, so only the synchronous portion (HTTP proxy and DNS lookup) are done on a thread pool thread; the rest of the request is truly asynchronous. At least, this is true for some platforms.