[concurrency-interest] Extended access methods for Atomics (and AQS)

Martin Buchholz martinrb at google.com
Thu Apr 22 03:09:29 EDT 2010


As we've seen in threads elsewhere,
the documentation of the existing methods
in j.u.c.atomic can be improved with
regards to security and memory model effects,
and to provide better usage guidance.

Given the history, I would think it best to
add any new methods to the existing classes,
but to provide the better guidance and more
off-putting names.  We really can say in the
javadoc:

<b>This method is for use by experts only.</b>

People scratch their heads about lazySet
http://stackoverflow.com/questions/1468007/atomicinteger-lazyset-and-set
Doug has already written some excellent doc
that just happens to be in a place few people will look.

I also think that we could remove most of the
performance overhead of Updater classes
relative to Unsafe, given some heroic
engineering effort.  Hotspot could intrinsify
a call to newUpdater and return an instance
of a synthetic specialized class that did the
type checks in the signature of the methods.
Not that I'm volunteering.


More information about the Concurrency-interest mailing list