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

Doug Lea dl at cs.oswego.edu
Tue Nov 27 16:06:57 EST 2012


On 11/27/12 15:45, Jacy Odin Grannis wrote:
> Instead, by putting it in sun.misc, it forces library writers to make
> more difficult choices.

Yes, this is the byproduct of some very deliberate decisions of
the form: People might do X by mistake. So let's make it as
painful as possible to do X at all, by requiring that people
move outside the language proper and use sun.misc.*.
The net result is that the ranks of Unsafe users, especially ,
grows steadily.

>
> As far as Unsafe goes...I think it's problematic that it does get used as much
> as it does.  The Atomic FieldUpdaters exist, the big argument against them seems
> to be the parameter safety checks.

The best bet for improving this situation continues to be to wait
for invokeDynamic field access manipulation to exist and to be
predictably fast. Which I think will someday happen but not soon.
Although even then, array element versions (which is probably the
most important/common case inside j.u.c) may escape this treatment.

-Doug





More information about the Concurrency-interest mailing list