Re: calling SSL_library_init multiple times
Hi Randy, 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 JBOn 2/28/06, Randy Turner [EMAIL PROTECTED] wrote: 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. -JB On 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 Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
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 onlybe 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 arecreated. From the documented return values,it always returns 1 but this doesn't mean it's reentrant Cheers,Nils__OpenSSL Project http://www.openssl.orgUser Support Mailing Listopenssl-users@openssl.orgAutomated List Manager [EMAIL PROTECTED]
RE: calling SSL_library_init multiple times
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 dont think thats what was intended. I think the last sentence is more accurate if you have a multi-threaded application, and youve 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. -JB On 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 Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
Re: calling SSL_library_init multiple times
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 Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
Re: calling SSL_library_init multiple times
Jagannadha Bhattu G [EMAIL PROTECTED]: Hi, Can I call SSL_library_init multiple times in my code under different threads? From the documented return values, I conclude that it should be possible. Can some one confirm it? Thanks JB Yes it's possible. I'm doing like this for now... , but I'm not shure whether this is correct... //wbr - Andrew __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
calling SSL_library_init multiple times
Hi, Can I call SSL_library_init multiple times in my code under different threads? From the documented return values, I conclude that it should be possible. Can some one confirm it? Thanks JB