RFR (S) CR 8014966: Add the proper Javadoc to @Contended

Aleksey Shipilev aleksey.shipilev at oracle.com
Thu May 30 08:49:48 UTC 2013

Hi Roger,

On 05/29/2013 10:48 PM, roger riggs wrote:
> Thanks for the references.  Currently, you are correct, I don't need it.

Now I am envious!

> Has it been considered that highly contended field should not be allocated
> in the object itself anyway but in some pool or structure better suited
> to its access characteristics?  A read-only indirection could provide
> some ability to allocate contended locks elsewhere where they would
> not disrupt the allocation mechanism.  For example, in a pool
> of write-only or write-mostly values for the processor/core/thread.
> Of course, that has an access cost too.

That's an interesting idea, and we had discussed it a bit internally.
The major problem is a mess in runtime to segregate the accesses to the
plain fields and the contended ones. This change is much more intrusive
than the smart padding within the instance itself; and the benefits are
unclear. You will still have to reserve the space at the allocation time
(yes, sophisticated schemes can do that lazily), you still have
indirection, etc.

That said, it might be our thing to do once we see it is actually
required. At this point, we better have the version which works
absolutely correct in all the scenarios.


More information about the core-libs-dev mailing list