Many thanks to all who guided me on several Win32 issues I had last week. I 
have yet another trivial question that has probably been asked many times 
but with some context. I am trying to understand the general idea of having 
multi-threaded access to the OpenSSL API.

In a very simple SSL client program, I have partitioned the calling such 
that I call the following functions in main()

SSLeay_add_ssl_algorithms
SSLv3_client_method
SSL_load_error_strings

and the following in each thread

SSL_CTX_new
SSL_new
SSL_write
SSL_read
SSL_shutdown
SSL_free
SSL_CTX_free

The threads are worker-pool threads. Is this a good model to follow ?

I am guessing that this can be optimized by not doing the SSL_CTX_new and 
SSL_CTX_free once per thread as opposed to once per iteration of the thread. 
Is this a valid approach ? Will it result in any leaks ?

Based on any known bugs, should I serialize access to any function(s) in 
particular to avoid these issues ?

Any other issues that you can think of, which I haven't asked :-?

Thanks in advance,

Robert



_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to