Introduction The purpose of this article is to describe new method onSpinWait() added to Thread class in JDK 9, including its usage, the pros and cons and also covering few other alternatives. onSpinWait() was part of JEP 285 to allow Java code to hint CPU there is a busy-waiting loop that may burn few CPU-cycles…