Synchronized methods and virtual threads

masoud parvari masoud.parvari at gmail.com
Sat Jun 1 17:15:28 UTC 2024


The fix is in the loom repo, not in the mainline yet, and most probably
won't make it to jdk 23.

So replacing synchronized with ReentrantLock is still the solution.


On Sat, Jun 1, 2024 at 6:57 PM Alex <filia.aleks at gmail.com> wrote:

> Hi everyone,
> I have one question about the synchronized methods and virtual threads.
> So in Java 23 the issue with pinned threads for synchronized methods was
> fixed.
>
> Before this fix many projects did fixes and replaced synchronized with
> Lock. What is the latest recommendation? Keep replacing synchronized with
> Lock or wait for Java 23 and use synchronized methods?
>
> Thanks,
>
> Alex Filichkin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20240601/3acd5042/attachment.htm>


More information about the loom-dev mailing list