[concurrency-interest] AtomicReference weakCompareAndSet "Mayfailspuriously"?

Doug Lea dl at cs.oswego.edu
Thu May 18 19:50:02 EDT 2006


Boehm, Hans wrote:

> 
> The real issue here may be the current documentation for
> AtomicReference.weakCompareAndSet, 

Presciently, Marting Buchholz filed a documentation bug for
weakCompareAndSet last week, so we should be able to do this soon.
(http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6425639)

> which seems to be lacking the
> requisite warnings, like: "This provides weaker memory visibility
> guarantees than compareAndSet.  If you have any doubt whether you should
> be using weakCompareAndSet or compareAndSet, then use compareAndSet."

Thanks. This is a good start.
Additional wording suggestions (from everyone!) would be welcome.

-Doug




More information about the Concurrency-interest mailing list