gnutls-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnutls-dev] Another solution


From: Simon Josefsson
Subject: [gnutls-dev] Another solution
Date: Mon, 26 Dec 2005 19:24:33 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

Here is another solution for removing the global variables without
changing any APIs [1]: replace all uses of the global variable with a
function call to a function that generate a local copy of the ASN.1
structures.  This will be slower, but would work.

However, gnutls_global_init() will not become thread safe by this
(because libgcrypt is used) but all the global variables in GnuTLS
would then be removed.

Thus, the above proposal to get rid of all global variables would not
solve your problem with thread safety anyway, so I propose we wait
with this idea until libgcrypt is thread safe or we support
alternatives to libgcrypt.

I again wish to stress that I believe this is a insignificant problem.
Simply have all libraries using GnuTLS call gnutls_global_init() in a
thread-unsafe initialization function, ultimately mutex synchronized
by the application.

[1] Changing APIs is really bad, that is why I'm having trouble with
your proposed approach.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]