[Unbound-users] Enable use of select() for waiting

W.C.A. Wijngaards wouter at nlnetlabs.nl
Mon Nov 25 14:12:22 UTC 2013


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

Hi Bjorn,

On 11/25/2013 02:57 PM, Björn Stenberg wrote:
> Hi.
> 
> I'm looking into adding DANE support to libcurl using the unbound
> library. Curl has an asynchronous API that supports a high number
> of parallel connections. Some use cases involve thousands of
> parallel connections to different hosts.
> 
> My understanding of
> https://unbound.net/documentation/libunbound-tutorial-4.html is
> that the libunbound asynchronous API uses a periodic polling call
> for each separate name lookup. This means that if we have a large
> number of lookups, a lot of work has to be performed just for
> waiting.
> 
> I would like to propose that the caller gets a file descriptor for
> each lookup, so he can use select() to wait on all pending lookups
> without having to loop through them.

With ub_fd() you can get a file descriptor for all of the open queries
for that ub_context.  And then use select() to wait on it?

If libcurl uses libevent internally, there is currently an
experimental API in svn trunk libunbound/unbound-event.h that exposes
a hook where you can get unbound to add its events to your libevent
event loop.

Best regards,
   Wouter


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSk1rGAAoJEJ9vHC1+BF+NhZ8QAIo0GDHCzYlIkuhxlweMk1DJ
mH/JFwakAepu9biGdb1hhSDE6qjyTKhaBfkjXsHOUL1YOuy1HRMn5dzxeFCrwh60
GYyoRB8l0N6CfpAwJcrzti2WANXMec5sNVEFZkMqfZbJ0mzpbLnegOmdZrspSAhl
idZTxxnatu4JDVlQ27Dl9XpHgAV7T5zxSDBlqKLM6ny21xXEzHjFdkX/XjNO5j0o
KUauokmpVcTFTwXTu+JvADFbnelIj63S6o4bH1HlOyKA7PlDaMaXCNs+uhV5wNOB
gcRcOlCmhYrvqIpkSu0UjNZv1gNdaGO9US6uVpkdDcybc62Mzwwxqf0PNqHM4Yp1
Y2MNLJlp5T7WBfrswuT0mmEScujojlozJKHofTqw3WXwNy7aBFJyVEF7WxhW9In1
p9Bck0qVmN7BfJ369nO1BQkP9UFadAf3q3Rtw0kQhraiblZ6YC+ZAbLaOPfh81iS
wca9qxcVvdlXq3Q6STsxe49WLP2C2pWwxfQHHxtVQbLWJ/yddVo/L3wmBJ5eRkW4
Zl6V9t0QBG+Fn+njAidkAfJqeueJYUTwYHhv7tyCVc1etRDZXM+vEZOrENrYUf4c
kawJA8CvQ/Xji9shHl1onf2z/KKuzziI56mnpbESj4vo78NzX5p8h8kdZ3kO/QNN
Wj2535vGz8m/rPzAvDCX
=EyE1
-----END PGP SIGNATURE-----



More information about the Unbound-users mailing list