RFR (S): JEP-142: Reduce Cache Contention on Specified Fields
forax at univ-mlv.fr
Mon Nov 26 09:35:48 PST 2012
On 11/26/2012 05:44 PM, Aleksey Shipilev wrote:
> On 11/26/2012 08:22 PM, Doug Lea wrote:
>> One small suggestion to slightly appease the nanny-state folks.
>> How about burying the annotation one lever deeper to
> But the construction of @Contended has nothing to do with atomics,
> right? (Yes, the sanest use case is to protect atomically-updated
I think you should re-write the javadoc to not use 'hot' (hot ->
optimize -> I should use it)
and talk about false sharing (with a link to the wikipedia article
You should mention that marking @Contented a field which is not volatile
unless there is proper fences.
And also mention that it may consume a lot of memory thus it should only
if there is a known issue.
Also, I'm not in favour of allowing to use @Contented on class,
if you want all fields to be marked as @Contented, just mark them as is.
Given that this annotation is here to solve a corner case, using the
in a class wide way in my opinion a door open to stupid usages. You
a class volatile if all their fields are volatile.
> "Nanny-state folks" would naturally presume annotating the
> plain field with @Contended will turn all operations on that field into
> atomics :)
> java.util.concurrent.herebedragons.Contended :)
> I think the high-level annotation is already good.
More information about the hotspot-dev