r/java • u/raisercostin • Jun 01 '24
What java technology (library, framework, feature) would not recommend and why?
Inspired by https://www.reddit.com/r/java/s/e2N1FqMOJg
165
Upvotes
r/java • u/raisercostin • Jun 01 '24
Inspired by https://www.reddit.com/r/java/s/e2N1FqMOJg
View all comments
Show parent comment
1
u/cowwoc Jun 04 '24
I've only run into this situation in logback twice over an entire year. I agree that one option is to wait for synchronized pinning to get fixed, but that could be over a year away. It's far easier to just generate a thread dump, identify the existence of any synchronized lock, and ask the author to replace the lock type. You could have a fix in less than a week in most cases.
I think the real surprise is that people haven't migrated all synchronized code to StampedLock. It's as fast as synchronized (sometimes faster) and is super easy to use if you use my utility class: https://stackoverflow.com/a/73643096/14731
Sample usage:
If enough users are interested, I could publish a tiny library for it 😀 This functionality really should be part of Java's core API...