[ldns-users] Can ldns be used asynchronously?

W.C.A. Wijngaards wouter at NLnetLabs.nl
Wed Aug 18 07:16:02 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Peter,

No it spawns one thread that is associated with the context.  The call
you talk about it for configuration what the context should do, and is
not used by most users (I think).  The thread stays present until you
delete the context, and keeps a cache for example.

Best regards,   Wouter

On 08/17/2010 07:36 PM, McCann Peter-A001034 wrote:
> W.C.A. Wijngaards wrote:
>> Not unless you code it yourself.  Libunbound
>> http://unbound.net/documentation/libunbound-tutorial-4.html can do
>> asynchronous queries.  
> 
> 
> Thank you, Wouter.  I might switch to using libunbound.
> 
> A question, though: I note that a call to ub_ctx_async
> sets whether to spawn a thread or fork a process.  But,
> why do I have to do either?  It seems like the file
> descriptor returned from ub_ctx_fd could be the UDP
> socket on which the library is waiting for a response
> packet.  In that case, a call to ub_process would both
> read this data from the socket and perform any other
> processing that might be necessary.  But, I guess you
> would also need to return a timeout value that the
> application would need to respect by calling ub_process
> at that time in case no response was received.
> 
> I am just a little concerned about the overhead of
> spawning a thread for each lookup.
> 
> -Pete

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkxriLIACgkQkDLqNwOhpPjqnwCfcpQkZXP1DX/zlDOrJMUaSGcA
dIkAmgN1Xwqi0D3dKvrtzTk2f52tlxor
=+kui
-----END PGP SIGNATURE-----



More information about the ldns-users mailing list