I seem to recall a comment about how MT locking is done in OpenSSL,
just a few days ago, on this list.

Anyhow, I've been pondering the caveats of the current locking
mechanism, which is current done with global locks for each structure
type.  This can become really inefficient if, for example, there are
several X509 operations going on at the same time with X509 data that
have no relation whatsoever (at least any memory relation) with each
other.  The comment I saw was that locking should really be per object
instead of per type, so that several X509 (in this example) operations
could take place simultaneously.

The drawback with moving locking to be per object is that we would be
creating a huge amount of them.  I can't imagine that it's too bad on
Unix using pthreads, since those are (as far as I understand them)
just a memory structure containing some bits of data.  However, under
some other operating systems, like Windows, I understand that mutexes
are handled through so called handles, and that it's a limited
resource (a bit like file descriptors on Unix?).  I'm sure one can
cough up more drawbacks...

Steve, can you confirm/deny what I just wrote?

Anyone, the above is thoughts about what can be done with OpenSSL to
connect the objects with their locks, making them single protected
areas instead of protected in group.  Should we take such a thing in
consideration?  Other comments?

(and yes, I know, that will be a HUGE change, and will break some
operations (most specifically, all those who currently use the CRYPTO
lock routines.  On the other hand, those can still be supported, just
not used internally...  I think...).

-- 
Richard Levitte   \ Spannv�gen 38, II \ [EMAIL PROTECTED]
Redakteur@Stacken  \ S-161 43  BROMMA  \ T: +46-8-26 52 47
                    \      SWEDEN       \ or +46-708-26 53 44
Procurator Odiosus Ex Infernis             -- [EMAIL PROTECTED]

Unsolicited commercial email is subject to an archival fee of $400.
See <http://www.stacken.kth.se/~levitte/mail/> for more info.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to