[gnutls-dev] Re: living without global variables

Werner Koch wk at gnupg.org
Tue Jan 3 15:37:37 CET 2006


On Tue, 3 Jan 2006 14:36:26 +0100, ZIGLIO, Frediano, VF-IT said:

> There is also another possibility that can fix (I hope) all problems.
> Mainly initializers in libgcrypt are functions that manage module
> registrations. Module registrations just add entries to some linked

Actually these are the less critical ones.  For various other reasons
we need a locking mechanism anyway and thus the static tablle creation
does not really help.

If you are only working with GNU based system, you can try to init
Libgcrypt from the actual application (maybe even with a Libgcrypt
loader plugin) so that the other plugins will use the already loaded
and initialized Libgcrypt.

To get everything right all libraries between Libgcrypt and and the
application must be aware of the threading system in use.  We tinkered
a lot with libgcrypt to make this as easy as possible and ventually
setlled for the current solution - it is by far the most portable one.
All other more automagically working implementations are either non
portable or lead to headaches when writing the build rules for larger
applications.


Shalom-Salam,

   Werner







More information about the Gnutls-dev mailing list