Relation between ub_fd/ub_poll/ub_process and ub_ctx_async

W.C.A. Wijngaards wouter at nlnetlabs.nl
Mon Feb 27 08:02:03 UTC 2017


Hi Rick,

On 24/02/17 18:51, Rick van Rein via Unbound-users wrote:
> Hello,
> 
> I'm not quite clear on the relation between ub_ctx_async() on the one
> hand, and ub_fd(), ub_poll() and ub_process() the other hand.  The
> latter triple can clearly be integrated with an event loop, but the
> former seems to suggest that background threads or processes are used.

These calls all make a thread or process that does the work.  And then
the result is piped back to you.

> If I use ub_resolve_async() but don't call ub_ctx_async() at all, will
> there be no background thread or process and can I instead do my own
> integration with an event loop?  Otherwise, how does integration with an
> event loop work?

Look into unbound-event.h, where ub_resolve_event() is there so you can
integrate the resolution process in to your event loop.

Best regards, Wouter

> 
> -Rick
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.nlnetlabs.nl/pipermail/unbound-users/attachments/20170227/e4eb50ba/attachment.bin>


More information about the Unbound-users mailing list