|
|
|
|
|
by pron
4591 days ago
|
|
Yes. High performance Java code sometimes makes use of JVM intrinsics, accessible through the sun.misc.Unsafe class. Those are JITted down to a simple memory access instruction. That class also has intrinsics for CAS, and in JDK 8 it's got intrinsics for different memory fences as well. Those calls are compiled to a single native instruction. For example, the Java Chronicle library[1] uses these techniques, as well as memory mapped files, to implement fast persistent message queues. [1]: https://github.com/OpenHFT/Java-Chronicle |
|