[gnutls-dev] living without global variables

Nikos Mavrogiannopoulos nmav at gnutls.org
Mon Dec 26 12:16:46 CET 2005


On Wednesday 21 December 2005 19:05, Bryan Henderson wrote:

> gnutls_global_init() would still be around for programs that want the
> simplicity of global variables and don't care about modularity.
> gnutls_global_init() would create a session group object and assign
> its handle to a global variable.  gnutls_init() uses the global
> session group handle.

This will not help. I don't think there is a practical advantage of 
that, but if you want to do something like that you have to change
all the x509 parsing functions to accept the "so called" session group.
The constant stuff that gets initialized by gnutls_global_init() has 
nothing to do with tls sessions, they are only used for the ASN.1 
parser, which is used in certificate parsing. So as far as you are 
concerned gnutls sessions are thread safe, except for the libgcrypt 
part of course.

-- 
Nikos Mavrogiannopoulos




More information about the Gnutls-devel mailing list