Can someone please give me some links to some basic tutorials on
"locking callbacks".  I tried different searches on Google, but no links
to basic tutorials came up.  I tried different search criteria.

To date, I have never used them on the job and don't recall learning or
hearing about them in school.

Thanks.

Regards,
Lee

-----Original Message-----
From: owner-openssl-us...@openssl.org
[mailto:owner-openssl-us...@openssl.org] On Behalf Of Steffen DETTMER
Sent: Monday, February 15, 2010 11:04 AM
To: openssl-users@openssl.org
Subject: Re: Thread locking functions

* Sad Clouds wrote on Mon, Feb 15, 2010 at 14:52 +0000:
> On Mon, 15 Feb 2010 15:19:23 +0100
> "Steffen DETTMER" <steffen.dett...@ingenico.com> wrote:
> > Delegating functionality via callbacks allows arbitrary 
> > implementations; I would not consider this lame
> > - but clean, strong, orthogonal, KISS and divide-and-conquer :)
> > 
> > Neither ANSI-C nor ISO-C tell anything about multi-threading or 
> > mutex locking, so handling that transparently inside the library 
> > would introduce additional dependencies (e.g. to POSIX threads) and 
> > thus would not be portable.
> 
> I think pretty much every Unix platform standardised on Posix threads 
> by now. Using locking implies that you're using threads, and that is 
> Pthreads API on Unix.

yeah well if you have to support POSIX platforms only... how enviable!
But there are others, too... :)

> I still think it's library's responsibility to pick the most efficient

> locking primitives for a given platform and use them transparently, 
> without exposing the semantics to the application code.

I think this would require OpenSSL to know all platforms and usage ways,
which might not neccesarily be possible.

> What happens if your application is linked to other libraries which 
> use OpenSSL and try to set their own locking callbacks?

The same as what happens if you application is linked to a libc that is
re-targetted differently: it won't work :)

> I have a feeling the locking callbacks mechanism is the leftover from 
> the 90s era.

Even today there are embedded devices, for example.

If there is no need to introduce dependencies to POSIX, why should
OpenSSL do this, limiting itself? Allowing arbitrary implementation by
such a way has advantages I think. In Java context someone may even call
it Dependency Injection or Inversion of Control pattern (just to use a
buzzword :)).

oki,

Steffen


 
About Ingenico: Ingenico is a leading provider of payment solutions,
with over 15 million terminals deployed in more than 125 countries. Its
2,850 employees worldwide support retailers, banks and service providers
to optimize and secure their electronic payments solutions, develop
their offer of services and increase their point of sales revenue. More
information on http://www.ingenico.com/.
 This message may contain confidential and/or privileged information. If
you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose or take any action based on
this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation.
 P Please consider the environment before printing this e-mail
 
 
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to