synchronized - sergeyzolotukhin/learn-java-gradle GitHub Wiki

interpreter Runtime

https://github.com/openjdk/jdk/blob/9d4fbbe36d85d71ce850bb83bbfb1ce1d3e8dd23/src/hotspot/share/interpreter/interpreterRuntime.cpp#L736

synchronized

https://www.infoworld.com/article/2170484/jw-archives-how-the-java-virtual-machine-performs-thread-synchronization.html https://wiki.openjdk.org/spaces/HotSpot/pages/11829266/Synchronization https://medium.com/@AlexanderObregon/how-javas-thread-synchronization-works-99c5ba3cda85 https://nataliiadziubenko.com/2025/02/01/javas-synchronized-explained.html#:~:text=The%20JVM%20knows%20that%20a,methods%20of%20the%20same%20instance.

https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/synchronizer.cpp

Object Monitor

https://medium.com/@mec_test_1/a-trip-to-jvm-internal-e64725c2633c https://wiki.openjdk.org/spaces/HotSpot/pages/46956549/Native+Monitors+Design https://medium.com/@nikolaykudinov/how-javas-wait-really-works-a-deep-dive-into-objectmonitor-part-1-7b87dc64bf50 https://www.artima.com/insidejvm/ed2/threadsynchP.html https://codegym.cc/groups/posts/267-better-together-java-and-the-thread-class-part-ii--synchronization

https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/objectMonitor.cpp

Object-Monitor Implementation

https://blog.openj9.org/2019/04/02/object-monitor-implementation/#:~:text=In%20OpenJ9%2C%20object%2Dmonitors%20(,which%20is%20referred%20as%20deflation.

https://openjdk.org/jeps/8183909#:~:text=Description,needed%20to%20do%20the%20work. https://wiki.openjdk.org/spaces/HotSpot/pages/42598857/Async+Monitor+Deflation https://rednirus.medium.com/inside-javas-synchronized-part-2-the-heavyweight-fat-lock-ca49e5938274

mutex + wait list

https://mortoray.com/how-does-a-mutex-work-what-does-it-cost/ https://stackoverflow.com/questions/71425393/what-will-cpu-do-when-a-thread-waiting-for-a-mutex#:~:text=What%20actually%20happens%20is%20that,or%20less%20how%20things%20are.

java concurrency lock overhead

overhead -> context switch & kernel space call

⚠️ **GitHub.com Fallback** ⚠️