[gnutls-dev] Re: living without global variables

Simon Josefsson jas at extundo.com
Wed Dec 28 10:07:12 CET 2005

bryanh at giraffe-data.com (Bryan Henderson) writes:

>>This is a one time call initialization function, so it is 
>>perfectly ok to leave the thread stuff to the called application.
> The reason it's not _perfectly_ OK is what I started this whole
> discussion with: lack of modularity.  The calling code may be a module
> of a larger program.  That larger program may contain another module
> which also uses GnuTLS.  The two modules run in their own threads.  As
> modules, they don't know about each other and cannot coordinate their
> calls to gnutls_global_init().  Modularity also forbids the code which
> is the parent of the threads/modules from knowing that GNUtls is down
> inside those modules, so the parent code can't call
> gnutls_global_init() either.
> It's _reasonable_ to produce a GnuTLS that has a nonthreadsafe
> gnutls_global_init() and not threadsafe alternative -- it just means the
> library isn't all it could be.

If there is a way to fix the problem, without causing other problems,
of course we will do it.

More information about the Gnutls-devel mailing list