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

Alan Bateman Alan.Bateman at oracle.com
Tue Nov 27 15:28:59 EST 2012


On 27/11/2012 18:25, Doug Lea wrote:
>
> But you ship code with sun.misc.Unsafe :-)
> As it stands, sun.misc is the place in which non-standard but
> universally implemented, platform related, expert-user-only APIs reside.
> 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.
>
> 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
I think it's time to consider a new namespace for this and what might 
follow. As the intention is not to include it in Java SE then something 
like jdk.vm.Contended might be a candidate to think about. I also think 
it's time to think adding a "supported" jdk.vm.Unsafe but that's a 
bigger discussion.

One thing about @Contended in sun.misc is that I assume it's not going 
to work when running with a security manager. It might also make it 
harder to move to modules with strongly enforced boundaries as modules 
will only export "supported" APIs. Even without modules then I assume 
that expert-users would at least have some aversion to using sun.* APIs 
and the javac warning that goes along with it.

-Alan.


More information about the Concurrency-interest mailing list