[Unbound-users] Using libunbound from other languages

Miek Gieben miek at miek.nl
Mon Jul 22 10:32:34 UTC 2013


Hello,

I'm struggling with the following use case and I'm not sure the solution lays in
extending my code or bug Woute^H the unbound developers with requests.

In this case I'm talking about using libunbound in Go and the locking issues
that can occur with wrt to the crypto library that is used.

In Go you do not have control over the amount of OS threads the runtime uses.
Go uses goroutines and N of those routines are mapped to an OS thread at any moment
in time. 

So if I'm using libunbound in my Go code it would be a good thing to tell OpenSSL
that it needs to use locking because I might use threads. However, with (lib)unbound:

* I cannot (easily) detect at runtime which crypto library unbound uses
* I do not link with a crypto library myself directly, so setting up the locking
  feels a bit strange
* Also there is not thread_id in Go, so I cannot tell openssl this

My feeling is that 'ub_openssl_lock_init' (in util/net_help.c) should be moved
to libunbound, so that I can "just" call it from Go when I setup the library for Go use, but
I might be wrong.

How do other languages wrapping libunbound deal with this?

- Grtz,

 ---
   Miek Gieben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.nlnetlabs.nl/pipermail/unbound-users/attachments/20130722/2eecac46/attachment.bin>


More information about the Unbound-users mailing list