Thanks for the effort and the reply. I have changed the design of my library interface to the applications to include a init call so that I do not need to worry about this.
Warm regards
JB
The first sentence of the explanation below seems to infer that its ok to call ssl_library_init() from each thread that might want to access the SSL library.
I don't think that's what was intended.
I think the last sentence is more accurate – if you have a multi-threaded application, and you've "hooked" the static and dynamic mutex functions to allow OpenSSL to correctly operate in a multi-threaded environment, then SSL_library_init() should only be called once, during application initialization. This single call will initialize the library for all threads. This is my interpretation of from what I have gleaned from the docs and sources.
Randy
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Jagannadha Bhattu G
Sent: Tuesday, February 28, 2006 1:42 AM
To: openssl-users@openssl.org
Subject: Re: calling SSL_library_init multiple times
Thanks Nils and Andrew for the replies.
-JBOn 2/27/06, Nils Larsch <[EMAIL PROTECTED]> wrote:
Jagannadha Bhattu G wrote:
> Hi,
>
> Can I call SSL_library_init multiple times in my code under different
> threads?
as SSL_library_init() initializes global tables it should only
be called from one thread a time and of course no other thread
should use the global data while SSL_library_init() is running.
Ideally it should be run once before the threads using ssl are
created.
> From the documented return values,
it always returns 1 but this doesn't mean it's reentrant
Cheers,
Nils
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager [EMAIL PROTECTED]