0

Is there a way to perform a double-width (16-byte) compare-and-swap in Java if the hardware supports it (e.g. using CMPXCHG16B on Intel)?

galym
  • 133
  • 4

1 Answers1

0

No.

There is no instruction in the Java Byte code specification that covers that. And there is also nothing in the Java Language specification to work around "deficiency".

So, theoretically, a JVM implementation might compile certain Java byte code sequences in order to use such hardware based instructions. But as said: that would be implementation specific.

GhostCat
  • 137,827
  • 25
  • 176
  • 248