From: Eric Wong Date: 2019-02-06T10:21:48+00:00 Subject: [ruby-core:91422] Re: [Ruby trunk Feature#15553] Addrinfo.getaddrinfo supports timeout Masaki Matsushita wrote: > > getaddrinfo_a(3) still spawns background threads in glibc; so not a big win. > As I briefly looked through glibc code, it seems to share and reuse > its background threads. > Please take a look at glibc/resolv/gai_misc.c and related files. Right, however Ruby 2.6+ also has USE_THREAD_CACHE enabled to reuse threads. For applications which already uses short-lived (Ruby) threads; this can even be a win because reusing Ruby threads can improve locality. I prefer sticking to resolve.rb. c-ares may be a another option if resolve.rb isn't fast enough. getaddrinfo_a(3) is the worst option IMHO. Unsubscribe: