Does YourKit report ReentrantLocks?

I am trying to reduce lock conflict on specific code in my application. To identify the code with a high degree of blocking, I connect YourKit to my application and use the “Monitor” tab and see that the locks caused the thread that I am going to block. My ultimate goal is to not have red dots for this thread on the Theme tab in the YK GUI.

Often a statement arises from a read / read lock using the built-in lock, so they can be improved with ReentrantLockinstead of internal locking. Indeed, when I tried this, YourKit reported lower disputes. How reliable is this information? Is your ReitrantLock report using your KitKit correctly?

I am using YourKit 8.0.24 on Solaris 10 with the 32-bit JVM Sun 1.6u18.

+3
source share
2 answers

It seems that YourKit is currently not reporting ReentrantLockas locked on the Subject tab.

0
source

Instead of following the principle of blocking, try creating an application without blocking. With mutable variables and classes in java.util.concurrent, you can often write algorithms without locking, and therefore not have locking.

-2
source

Source: https://habr.com/ru/post/1750128/


All Articles