Replace implementation of synchronized with Locks #17724
bishabosha
started this conversation in
Feature Requests
Replies: 1 comment
-
I see that in JEP 425 they suggest that this replacement should only be made for frequently running parts of code, but I assume this is because of the associated migration cost of changing all possible synchronised blocks. Also maybe this is not an issue for blocks that never touch IO |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As mentioned in https://github.com/lampepfl/dotty/pull/15296/files#r885743554, JDK 19 will launch with virtual threads (AKA project Loom), however, synchronised blocks will pin the OS thread, reducing throughput.
in JEP 425 Oracle suggests to use ReentrantLock instead of synchronized. However is there any reason why we couldn't globally replace synchronised blocks in the backend by locks?
Beta Was this translation helpful? Give feedback.
All reactions