RFR JDK-8234049: Implementation of Memory Access API (Incubator)

John Rose john.r.rose at oracle.com
Fri Dec 13 00:22:18 UTC 2019

On Dec 9, 2019, at 10:16 AM, Peter Levart <peter.levart at gmail.com> wrote:
> What do you think? Might this be better performance wise?

Yes, a fast positive proof that the access is allowed can be
implemented along the lines you mention.

The owner token could be overloaded in additional ways, if and
when we do more patterns of sharing.

The case of a permanently shareable heap-allocated segment could
be handled by a similar fast check, if some constant sentinel value
ALL_THREADS is stored in the owner instead Thread.current().

The case of a temporarily shareable segment, held jointly by several
threads, could be handled by an owner token which was suitably tied
to those threads.

This suggests that “owner == currentThread()” could be at some point
generalized to “owner.accepts(currentThread())” assuming that the
fast paths of OwnerSet::accepts could be optimized well.

— John

More information about the core-libs-dev mailing list