[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: making gnutls depended to pthread
From: |
Simon Josefsson |
Subject: |
Re: making gnutls depended to pthread |
Date: |
Tue, 29 Jun 2010 11:36:16 +0200 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) |
Nikos Mavrogiannopoulos <address@hidden> writes:
> Hello,
> I've been thinking it for quite some time but given the bug report:
> https://savannah.gnu.org/support/?107409 , I think it might be relevant.
> GnuTLS due to its use of random numbers will always need a global pool
> to be accessed, and thus locking is mandatory. How about making a new
> gnutls_global_init2() that accept flags such as USE_SYSTEM_LOCKS (that
> would be pthread for linux), by default? This way gnutls will initialize
> all libraries that it is depended on using the default threads for each
> system.
I don't want to see GnuTLS require pthreads, as pthreads doesn't exist
on several platforms (e.g., Windows).
Even on GNU/Linux I'm not sure pthreads is universal, I think both GNU
Pth and NPTL is still in wide use.
So I think a flag USE_SYSTEM_LOCKS flag would be confusing, as it isn't
clear what the application is getting -- one library may be using the
system's NPTL library and another library may be using the system
-lpthread and a third library may use GNU Pth, and if the all are linked
into one application, things will break badly.
Doesn't a gnutls_global_set_mutex-approach where the caller provides the
mutex functions solve this problem?
/Simon