[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Async DNS lookups

From: Ken Raeburn
Subject: Re: Async DNS lookups
Date: Tue, 2 Nov 2010 12:15:10 -0400

On Nov 1, 2010, at 12:09, Tom Tromey wrote:
> A couple other approaches come to mind as well.
> You could run the synchronous resolver in a new thread, and have the
> main thread run the event loop.
> You could use a small helper program instead of calling the resolver
> in-process.  That is basically the same as the previous idea,
> substituting a process for a thread.

These would have the advantage that, rather than interacting with DNS directly, 
you can call getaddrinfo and use /etc/hosts or anything else configured by 
nsswitch or equivalent.  Assuming that all name-resolution calls should go 
straight to DNS (when you're not specifically looking for non-A/AAAA/PTR data) 
would be incorrect....

I think getaddrinfo_a looks nice, but I'd rather not use it unless we also have 
a workaround for non-glibc systems.  Presumably that would use your basic "spin 
off a thread that blocks in getaddrinfo and invokes a callback when done" 
approach, which (according to the blog Tom pointed to) is all getaddrinfo_a 
does anyways.  Maybe that means the code could be borrowed; maybe that means we 
should just implement the latter and not bother with getaddrinfo_a.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]