[concurrency-interest] regarding Striped64 class-

√iktor Ҡlang viktor.klang at gmail.com
Tue Sep 6 07:57:43 EDT 2011

On Tue, Sep 6, 2011 at 1:00 PM, Doug Lea <dl at cs.oswego.edu> wrote:

> On 09/06/11 04:50, Yechiel Feffer wrote:
>> Why are the padding vars of the Cell declared as volatile too ? Sure-they
>> are
>> not touched so no cost. Is it related to Jvm reordering ?
> Until some standardized form of advice appears (a new "@Contended"
> annotation is the best proposal I've heard), the most effective
> way to do padding is entirely empirical. The way it is done
> in Striped64.Cell works well for volatile longs on current
> versions of OpenJDK/hotspot and IBM J9, and might not generalize.
> However, VMs are known to sometimes reorder fields based on
> types and qualifiers, so using the exact same types and qualifiers
> is a good rule of thumb.

Would be nice with a @NoFalseSharingPlease ;-)

> BTW, people seeing a lot of cache contention problems might
> also try the hotspot switch -XX:+UseCondCardMark.
> -Doug
> ______________________________**_________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.**oswego.edu <Concurrency-interest at cs.oswego.edu>
> http://cs.oswego.edu/mailman/**listinfo/concurrency-interest<http://cs.oswego.edu/mailman/listinfo/concurrency-interest>

Viktor Klang

Akka Tech Lead
Typesafe <http://www.typesafe.com/> - Enterprise-Grade Scala from the

Twitter: @viktorklang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20110906/302deab5/attachment.html>

More information about the Concurrency-interest mailing list