On 29 Jun 2026 18:12, Vinnie Falco wrote:
On Mon, Jun 29, 2026 at 8:10 AM Andrey Semashev via Boost <boost@lists.boost.org <mailto:boost@lists.boost.org>> wrote:
My general preference is that it is best to avoid spawning internal threads and instead design API in such a way that the user provides a thread, if one is needed.
We try to do that but sometimes the internal thread cannot be avoided. For example domain name resolutions are inherently synchronous. User code doesn't run in the implementation-defined thread which Corosio launches for this.
Strictly speaking, asynchronous DNS resolvers do exist (e.g. c-ares). But I understand that they may not be available on a given system, and an implementation with an extra thread is needed as a fallback. In this case, I would still prefer an option for a user to provide his own thread for the resolver.