[concurrency-interest] @Contended (JEP-142)

Roman Elizarov elizarov at devexperts.com
Wed Nov 28 11:59:02 EST 2012

Going down this path we should have an @Unsafe public annotation, too. In a trusted environment with supporting implementation the annotated piece should use unsafe code for a better performance (just like a @Contended annotation is basically a performance optimization hint). Access to @Unsafe arrays  will skip range checks, @Unsafe AtomicFieldUpdaters will skip type checks (and will works as fast as with sun.misc.Unsafe but without the unpublic sun.misc part of it), etc.

-----Original Message-----
From: concurrency-interest-bounces at cs.oswego.edu [mailto:concurrency-interest-bounces at cs.oswego.edu] On Behalf Of Gregg Wonderly
Sent: Wednesday, November 28, 2012 8:43 PM
To: Aleksey Shipilev
Cc: Doug Lea; Concurrency-interest at cs.oswego.edu
Subject: Re: [concurrency-interest] @Contended (JEP-142)

The annotation doesn't have to have the Hotspot support in earlier or non-implementing environments (Dalvik for example).  Just putting the @interface definition into all appropriate distributions, would seem like the easy way to introduce it.  Then, later, actual work can occur to make the changes needed or each environment.

Going down that path, makes me feel like having it in a more "public" package would be a better choice.  The name "Contended" is now going to be a "reserved" 
name for many people, when used in annotation form.  So, why not just make it a publicly defined "annotation" which has appropriate implementation in appropriate environments?


On 11/28/2012 3:53 AM, Aleksey Shipilev wrote:
> On 11/28/2012 01:44 PM, √iktor Ҡlang wrote:
>>      Would it help adoption if this would get backported to JDK7 (you will
>>      have to have the recent update release nevertheless)? Would that be
>>      sensible to backport to JDK6 at all?
>> Even if that was done, what about J9, Dalvik etc?
>> I think the sad fact here is that it will essentially only be usable 
>> within the JDK for the foreseeable future.
> (I'll let Doug to chime in on J9, Dalvik, etc. endeavors with 
> @Contended, if there are any).
> My question is very pragmatic though: if there is a strong desire to 
> use this within Oracle JDK7, we can explore how much it would take to 
> backport. Our current inclination is to use that in JDK8 only, but we 
> can take the community response into the consideration.
> -Aleksey.
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest

Concurrency-interest mailing list
Concurrency-interest at cs.oswego.edu

More information about the Concurrency-interest mailing list