* Sad Clouds wrote on Mon, Feb 15, 2010 at 13:18 +0000: > 2. Rationale for callbacks? > > Pushing some of the responsibility for locking OpenSSL internal > structures to application developers seems a bit lame. Why not get rid > of locking callbacks and have OpenSSL handle it transparently inside > the library? This promotes the idea of abstract data types and > encapsulation and avoids the whole mess of static/dynamic callbacks.
(I'm just guessing - please correct me where I'm wrong). 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 there is no abstract way of locking. For example, mutex locking can be done using a `recursive mutex' (such as locking in Java), but others consider this wrong and never use it; or you might want to use a data type in reentrant functions and thus cannot lock at all (non-recursively); a platform may have globally valid semaphores only or a limited number of them or... So many things to consider that I doubt it could be encapsulated correctly. oki, Steffen -- --[ end of message ]----------------------------------------------->8======= 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