[concurrency-interest] regarding Striped64 class-
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
>> 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.
> Concurrency-interest mailing list
> Concurrency-interest at cs.**oswego.edu <Concurrency-interest at cs.oswego.edu>
Akka Tech Lead
Typesafe <http://www.typesafe.com/> - Enterprise-Grade Scala from the
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest