Single byte Atomic::cmpxchg implementation

Erik Österlund erik.osterlund at lnu.se
Thu Sep 11 11:18:22 UTC 2014


On 11 Sep 2014, at 10:22, Andrew Haley <aph at redhat.com> wrote:
> From the AArch64 project's point of view, all we need is for the
> single byte Atomic::cmpxchg implementation to be move into os_cpu/
> and we can do the rest.

I agree that it definitely needs to allow platform specific implementations. But I would also advocate not using __kernel_cmpxchg in MP AArch64 even for normal jint CAS for the simple reason that it only optimizes non-MP performance, and has an interface returning boolean instead of the old value needing a translation to the interface we expect, resulting in a less efficient implementation with two nested loops and a call (for normal jint CAS) instead of a single loop retrying only on spurious SC failure due to scheduling. But I'll leave that to you guys. :)

/Erik


More information about the hotspot-dev mailing list