Question: What Is Biased Locking in Java 15?Answer:Biased locking is an optimization of thread synchronization aimed at reducing synchronization overhead when the same monitor is repeatedly acquired by the same thread (i.e., when the same thread repeatedly calls code synchronized on the same object). In the example above, this means that the first time the add() method is called, the vector monitor is biased to the thread in which the test method is executed. This bias speeds up the monitor's acquisition in the following 9,999,999 add() method calls. |
Is it helpful?
Yes
No
Most helpful rated by users:
- What is Java 15?
- What is Text Blocks or Multi-line string in Java 15?
- What are New String and CharSequence Methods in Java 15?
- What is CharSequence.isEmpty() in Java 15?
- Provide the release notes of Java 15.