[concurrency-interest] Use Of putOrderedObject In ConcurrentHashMap Constructor

Martin Buchholz martinrb at google.com
Fri Mar 8 16:58:21 EST 2013


On Fri, Mar 8, 2013 at 6:34 AM, Richard Burnison <richard at burnison.ca>wrote:

> As of hg-005c0c85b0de, the main constructor in ConcurrentHashMap writes its
> initial Segment, s0, into a Segment array, ss, using
> Unsafe.putOrderedObject(ss, SBASE, s0). Subsequently, the final instance
> field, segments, is set to ss.
>

The latest version of  ConcurrentHashMap no longer uses segments.
http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/ConcurrentHashMap.java?view=markup

That said, it looks to me like you are right, and the call
to putOrderedObject is not strictly necessary.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20130308/fe5ab221/attachment.html>


More information about the Concurrency-interest mailing list