James Berry <[EMAIL PROTECTED]> writes:

> I will point out, however, that these implementations have been
> used since the dawn of time in Xerces

The problem with all three places where compareAndSwap is currently
used is that they use the so-called Double-checked locking which is
well known to be incorrect on multi-processor machines. In a nutshell,
the problem is that the modifications to the variable that points
to an object and to the object itself can be visible in another
thread on another processor in the wrong order (e.g., the pointer
variable is visible while the object is not). For more information,
see this article:

http://www.aristeia.com/Papers/DDJ_Jul_Aug_2004_revised.pdf

So I think now is good time to fix this especially since it appears
to be fairly easy.

Boris

-- 
Boris Kolpackov, Code Synthesis Tools
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to