A new build and a new structured concurrency API

Ron Pressler ron.pressler at oracle.com
Mon Nov 15 20:21:45 UTC 2021


We have just published a new Early Access build of Project Loom over on

The build is based on jdk-18+22, and now requires the --enable-preview flag to
use Loom features (when compiling, remember to also add `--release 18`).

The main new feature in this build is a new API for structured concurrency,
called StructuredExecutor. To learn more about its motivation, capabilities,
and use, please read this JEP draft [1] and the Javadoc [2]. Pay special
attention to the new methods added to Future, resultNow and exceptionNow
[3], and how they complement StructuredExecutor. One of the most exciting
capabilities of StructuredExecutor is the new structured thread-dump mentioned
in the JEP draft.

Another new feature is the ability to use virtual threads as Cleaner threads
[4]. We have also published a draft JEP for virtual threads [5]. The JEPs, like
the project, are still a work in progress.

As always, we appreciate feedback on these features from those who try them.
Please, download the new EA and tell us about your experience.

-- Ron

[1]: http://openjdk.java.net/jeps/8277129
[2]: https://download.java.net/java/early_access/loom/docs/api/java.base/java/util/concurrent/StructuredExecutor.html
[3]: https://download.java.net/java/early_access/loom/docs/api/java.base/java/util/concurrent/Future.html
[4]: https://download.java.net/java/early_access/loom/docs/api/java.base/java/lang/ref/Cleaner.html
[5]: http://openjdk.java.net/jeps/8277131

More information about the loom-dev mailing list