David Schwartz wrote:
>>I mean that if the order of memory write visibility between
>>processors can't
>>be g'teed, than a whole lot MORE than just DCLP crashes and burns ... How
>>in that case can anyone write safe MP code?
>>
>>D.

>
>
> The only correct and safe way to do it is with mutexes or their equivalent.
> DCLP is only useful as a platform-specific optimization that can be used
> when you 100% know it works on a particular hardware/compiler combination.
>
> DS
>

Since aquiring the mutex is already on the 'slow' track, couldn't you
just aquire a second (pointless) mutex inside the first around only the
'initialized=1;' assignment? If mutexes resolve the initial situation
then they must be implemented with a memory fence (in the itanium
model), and so they should be a high level way to put a memory fence in
when appropriate - without knowing if they're available on the hardware.

Andrew



>
> __________________________________________________ ____________________
> OpenSSL Project http://www.openssl.org
> Development Mailing List openssl-dev@openssl.org
> Automated List Manager majordomo@openssl.org

__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-dev@openssl.org
Automated List Manager majordomo@openssl.org