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

Aleksey Shipilev aleksey.shipilev at oracle.com
Thu May 30 08:55:02 UTC 2013


On 05/30/2013 12:49 PM, Aleksey Shipilev wrote:

On 05/29/2013 10:48 PM, roger riggs wrote:

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.

...actually the largest trouble: you have to garbage-collect off-instance fields somehow, which includes tracking the reachability, which probably entails write barriers for those fields... Remarkably, this sounds like another use for ephemerons :)

[---- I'd like to draw the line for metaphysical discussions here ----]

:)

-Aleksey.



More information about the core-libs-dev mailing list