Arno Garrels wrote:
> The DLL names are globally writable typed constants, set their values
> before the OpenSSL libraries are loaded.

Is there any advantage to use writable typed constants like

 const GSSLEAY_DLL_Name : String  = 'SSLEAY32.DLL';

instead of

 var GSSLEAY_DLL_Name : String  = 'SSLEAY32.DLL';


Both seems to work but I try to avoid the first one whenever possible because
it can break multi-threading when not used properly. For example I had a
commercial component that contained code like this to save some code lines:

 procedure SomeProc();
 {$J+} // enable writeable consts
    Buffer : array[0..31] of byte = (0, 0, ..., 0);
 {$J-} // disable writeable consts
    // read and write to Buffer like it's a variable

which caused problems when the procedure is used by different threads
simultaneously because all instances read and write to the same block in

I know this is not a problem with ICS but I wonder why writable consts are
used/preferred at all.


To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to