Timeline for supporting synchronized with virtual threads, was Re: JEP proposed to target JDK 19: 425: Virtual Threads (Preview)

Mark Rotteveel mark at lawinegevaar.nl
Sun Jun 5 09:13:25 UTC 2022


I have a question about the wording in JEP-425. Loom currently doesn't 
fully work with synchronized-blocks (underlying system thread will be 
pinned), and it currently says about that

"""
In a future release, we may be able to remove the first limitation above 
(pinning inside synchronized).
"""

This sounds rather vague/unspecific, and I wonder if this means "this is 
an unsolved problem and we don't know if we can ever solve this", or if 
this means "we'll fix it in the next preview" (or some other reasonably 
close release).

The reason I'm asking is that I maintain a JDBC driver that currently 
relies heavily on synchronized combined with blocking I/O, and rewriting 
it to use ReentrantLock or something, requires some investment of time. 
If support for synchronized will be available "soon" (say, ~1 year), 
that is an investment that doesn't really pay off (for me), if it won't 
materialize for years (or ever), rewriting *is* a worthwhile investment.

I guess I'm not the only one faced with such a decision, so a 
clarification on that point would be helpful to make a decision on 
whether or not to invest that time.

Mark

On 28-04-2022 20:46, mark.reinhold at oracle.com wrote:
> The following JEP is proposed to target JDK 19:
> 
>    425: Virtual Threads (Preview)
>         https://openjdk.java.net/jeps/425
> 
>    Summary: Introduce virtual threads to the Java Platform. Virtual
>    threads are lightweight threads that dramatically reduce the effort
>    of writing, maintaining, and observing high-throughput concurrent
>    applications. This is a preview API.
> 
> Feedback on this proposal from JDK Project Committers and Reviewers [1]
> is more than welcome, as are reasoned objections.  If no such objections
> are raised by 23:59 UTC on Thursday, 5 May, or if they’re raised and
> then satisfactorily answered, then per the JEP 2.0 process proposal [2]
> I’ll target this JEP to JDK 19.
> 
> - Mark
> 
> 
> [1] https://openjdk.java.net/census#jdk
> [2] https://cr.openjdk.java.net/~mr/jep/jep-2.0-02.html


-- 
Mark Rotteveel


More information about the jdk-dev mailing list