From: Sean Walton <[EMAIL PROTECTED]>

swalton> Arne Ansper wrote:
swalton> 
swalton> > Toomas Kiisk ([EMAIL PROTECTED]) reported that he was able to create more
swalton> > than 300 000 unnamed mutexes without problems.
swalton> 
swalton> Creating numerous mutexes is not a problem: cycling them
swalton> through and thrashing memory is.  The problem with the
swalton> implementation of mutexes is the fact that no library
swalton> maintains them quite the same.  For instance, Linux's and
swalton> Windows' implementation is likely to be wholly different.
swalton> The purpose of OpenSSL is to maintain portability.

Of course, but that's not a problem if the application can somehow
tell you the amount of bytes are needed for each mutex/critical section.

swalton> > using critical sections for intra-application locking is preferrable
swalton> > because they are much faster than mutexes (more than 50 times).
swalton> 
swalton> If you mean disabling multitasking, entering a protected
swalton> mode, or using processor-specific locking, the costs are less
swalton> than optimal.  The result would mean platform-specific code
swalton> being written for every critical section.  The result would
swalton> mean a product that buys little more gains while
swalton> exponentially increasing complexity.

Uhmmm, I dunno about making platform-specific code for every critical
section.  We already have locking callbacks, and I had no intention of
changing that.  I'm assuming that on Windows, those callbacks are
implemented through mutexes or critical sections (I'd do the latter).

swalton> Another problem is the assumption.  This discussion thread
swalton> assumes that the a lot of time is lost during mutex
swalton> management.  Has this been profiled?  I would suspect that
swalton> the points of optimization are tucked away elsewhere
swalton> (typically in the cyphers).  Managing mutexes is an overhead,
swalton> but I suspect it is very small compared to the rest of the
swalton> system.

Well, my point didn't have with mutex management per se.  Rather, I'm
worried about locking out some parts of the system with one lock.  It
kind of puts all threads handling that particular type (but not
necessarely instance) of data to a halt, except one.

-- 
Richard Levitte   \ Spannv�gen 38, II \ [EMAIL PROTECTED]
Chairman@Stacken   \ S-168 35  BROMMA  \ T: +46-8-26 52 47
Redakteur@Stacken   \      SWEDEN       \ or +46-709-50 36 10
Procurator Odiosus Ex Infernis                -- [EMAIL PROTECTED]
Member of the OpenSSL development team: http://www.openssl.org/
Software Engineer, Celo Communications: http://www.celocom.com/

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