New Early Access builds

Ron Pressler ron.pressler at oracle.com
Tue Apr 5 23:16:00 UTC 2022


Continuations are an unsafe construct in their unrestricted form, as not only a lot of Java code assumes that the identity of the thread cannot be changed mid-method, the compiler relies on that assumption as well. However, continuations restricted to a single thread can be put to some good use, such as generators. So, to answer your question, it is possible that we’ll see other JDK constructs that employ continuations under the hood.

I would note, however, that of the three examples you mentioned, the first is better served by virtual threads, and the second is not of interest to that many people if they can get their hands on virtual threads, and even then would often be better served by virtual threads with custom schedulers (which are also not in the current offering). So clearly, virtual threads is the application of continuations that gives the most bang for the buck, and other, less important, applications will be considered once we deliver virtual threads.

— Ron

> On 5 Apr 2022, at 22:46, August Nagro <augustnagro at gmail.com> wrote:
> 
> Thanks Alan looking forward to trying it.
> 
> Has there been any interest in adding back continuations?
> 
> They can already be implemented with a virtual thread + lock, but having
> more efficient access be ideal. Also, it's not always desired to suspend on
> every blocking operation.
> 
> Some use cases would be
> - Actor Frameworks
> - Async/Await in existing, non blocking code
> - Generators
> 
> On Tue, Apr 5, 2022, 11:33 AM Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
>> The builds at the Project Loom Early Access page [1] have been
>> refreshed. The latest builds are based on jdk-19+16.
>> 
>> There aren't any API changes compared to the previous build. There are a
>> lot of changes under hood and in particular, there are many changes in
>> the GC and runtime areas with several important fixes. The build
>> includes the update of ForkJoinPool that Doug Lea announced on the
>> concurrency-interest list recently - this update improves the
>> performance in cases such as message passing.
>> 
>> -Alan
>> 
>> [1] https://jdk.java.net/loom/
>> 



More information about the loom-dev mailing list