Mastering Java 11
上QQ阅读APP看书,第一时间看更新

Improvement goals

The general goal of JEP 143 was to increase the overall performance of how the JVM manages contention over locked Java object monitors. The improvements to contended locking were all internal to the JVM and do not require any developer actions to benefit from them. The overall improvement goals were related to faster operations. These include:

  • Faster monitor enter
  • Faster monitor exit
  • Faster notifications

The notifications are the notify() and notifyAll() operations that are called when the locked status of an object is changed. Testing this improvement is not something you can easily accomplish. Greater efficiency at any level is welcome, so this improvement is one we can be thankful for.