[concurrency-interest] Atomic.*lazyGet

Doug Lea dl at cs.oswego.edu
Wed Aug 8 09:22:46 EDT 2012


On 08/08/12 08:29, Aleksey Shipilev wrote:
> Hi,
>
> Inspired by Doug's API completeness endeavor in CHM, and recent
> WeakReference discussion, I had remembered the thing long haunting me.
>
> In short, I would like us to consider adding lazyGet() to our atomic
> primitives. Googling around haven't got me to any pointers if anyone had
> considered this before. If anyone had, please point me there.

See previous list discussions of "weakGet()" (which is a better name,
in line with weakCompareAndSet), at least as far back as 2006.
For example:
http://cs.oswego.edu/pipermail/concurrency-interest/2006-May/002526.html

I welcome Hans Boehm to summarize the reasons that we cannot
do this without first overhauling the JMM spec.
Well, we could do it, but if so, it would only have
we-hope-you-know-what-we-mean semantics, which is
not something most people are comfortable about for
fundamental concurrency constructs. The lazySet case,
that we did add without incorporation into JMM, was
different in that we were confident that we could spec
it formally without breaking things in a minor JMM revision
when it came up next. For a sense of what this would look
like, see near the end of the proposed/scrapped Fences javadoc
http://gee.cs.oswego.edu/dl/jsr166/dist/docs/java/util/concurrent/atomic/Fences.html


-Doug




More information about the Concurrency-interest mailing list