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

√iktor Ҡlang viktor.klang at gmail.com
Tue Nov 27 20:05:13 EST 2012

On Tue, Nov 27, 2012 at 7:25 PM, Doug Lea <dl at cs.oswego.edu> wrote:

> On 11/27/12 13:08, √iktor Ҡlang wrote:
>  I'd say that it serves as a hint to the JVM that padding would help if
>> possible,
>> so there wouldn't be a strict need to enforce that it is used. It would
>> be nice
>> to be able to ship the same code for different JDKs.
> But you ship code with sun.misc.Unsafe :-)

Haha, yes, of course, but the Cotended annotation is new, and I only use
sun.misc things that are available on all platforms we support.

> As it stands, sun.misc is the place in which non-standard but
> universally implemented, platform related, expert-user-only APIs reside.

Indeed, but will @Contended be magically available on old JDKs?
The only thing I want is not to be able to keep separate code bases for
JDK9 and then JDK8-6 just because @Contended is only present in JDK9.

> So seems to be the least controversial home for it. The main
> difference is that you won't be able to treat is as assumed to
> be present until JDK8. But this is also true of some other
> things like upcoming getAndAdd intrinisification.

Speaking of which, it would be preferrable to have a jvm.tools package that
is available for use for all JVM language implementations.


> I'd conclude by saying that other suggestions are welcome, but
> they aren't welcome by me :-) This seems like the only
> packaging that no one feels like they must try to veto .
> -Doug

Viktor Klang

Akka Tech Lead
Typesafe <http://www.typesafe.com/> - The software stack for applications
that scale

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

More information about the Concurrency-interest mailing list