> 2.    The following piece of code seems to have race condition, causing
> very long initialization time for our application, especially when there are
> very many processes and threads running in the system (file:
> crypto/rand/md_rand.c, line: 350):
> 
>       if (!initialized)
>               RAND_poll();
> 
>       CRYPTO_w_lock(CRYPTO_LOCK_RAND);
>       add_do_not_lock = 1;    /* Since we call ssleay_rand_add while in
>                                  this locked state. */
> 
>       initialized = 1;

Last time I checked, your software had to initialize the CRYPTO_lock
subsystem by creating and initializing an array of locks and passing it
in. This would have to be done before you create the rest of your
threads.

Can you initialize the random number generator at the same time
that you install the locks, and avoid this problem completely?

-- 
Harald Koch     <[EMAIL PROTECTED]>

"It takes a child to raze a village."
                -Michael T. Fry
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to