In two weeks, #Java19 will be released with some of Java's most anticipated features: virtual threads and structured concurrency! 🤩

To make the best use of virtual threads, servers/frameworks need to support them - here's a list of those that do (reply with those I missed). 🧵
📣 All of this is still experimental!

Virtual threads and the new APIs are (you need `--enable-preview` and the incubator module `jdk.incubator.concurrent` to use them) and so is support in these projects. You can help them mature over the next months by testing with your app.
The @JakartaEE server @TheApacheTomcat provided experimental support as a part of their 10.1.0-M16 release back in June, but there was a bug that broke HTTP/2 support if async IO was disabled. The unreleased 10.1.0-M17 will include a fix.

Details: tomcat.apache.org/tomcat-10.1-do…
The async Java-based HTTP server @JettyProject merged changes to support Loom in github.com/eclipse/jetty.…. It will be part of their 10.0.x release train, likely 10.0.12.

Keep an eye on their release page for details: github.com/eclipse/jetty.…
Helidon supports virtual threads since 2.2.0 (and 3.0): github.com/oracle/helidon…

But it does one better! 4.0 will come with a Nima (github.com/oracle/helidon…), a server written entirely around virtual threads with similar performance as Netty. Follow @helidon_project for updates!
Supersonic, subatomic Java server @QuarkusIO merged virtual thread support in May (github.com/quarkusio/quar…), which was released in version 2.10.0 in June.

(Here's a very interesting report by @clementplop on that: mail.openjdk.org/pipermail/loom…)

Release notes: github.com/quarkusio/quar…
Other projects have the topic on their roadmap:

@springframework has an issue slated for 6.0 (github.com/spring-project…), which implies to me that it would also be available in @springboot 3.0.

@micronautfw considers support in 4.0 (github.com/micronaut-proj…).
IDEs will work out of the box with virtual threads but could improve in at least two ways:

➀ Find a better way to select a thread than showing a drop-down box with potentially millions of them. 😬
➁ Show the relationship between them that's created by structured concurrency.
I know some IDEs have an issue that you can track, but as far as I can tell, they're not yet very active:

@EclipseJavaIDE has one on their BETA_JAVA19 milestone: github.com/eclipse-jdt/ec…

@VSCodeJava: github.com/microsoft/vsco…

What about you, @intellijidea? 😉
@EclipseJavaIDE @VSCodeJava @intellijidea If you've made it this far, can you do me one (or more ☺️) of these favors?

➀ Reply with projects that I missed (I will add them to this thread).
➁ Follow @BillyKorando - he has done most of this research.
➂ retweet 👇🏾
@EclipseJavaIDE @VSCodeJava @intellijidea @BillyKorando @netty_project @mooreds @vertx_project @WhiteWoodCity The cloud native extensible runtime @piranha_cloud supports virtual threads since July:

github.com/piranhacloud/p…

(Thanks @Thi_Hup for letting me know!)
@EclipseJavaIDE @VSCodeJava @intellijidea @BillyKorando @netty_project @mooreds @vertx_project @WhiteWoodCity @piranha_cloud @Thi_Hup The lightweight and simplicity-focused web framework @javalin_io uses virtual threads by default on #Java19+ since 4.0.0.ALPHA2 (from May).

To track when 4.0 releases: javalin.io/news/javalin-4…

(Thanks @Igfasouza!)
@EclipseJavaIDE @VSCodeJava @intellijidea @BillyKorando @netty_project @mooreds @vertx_project @WhiteWoodCity @piranha_cloud @Thi_Hup @javalin_io @Igfasouza Of course, @graalvm is no slouch either, and merged support for virtual threads in native images a few weeks ago. Looking forward to those JDK 19 builds! 😃

(Thanks, @fniephaus!)

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Nicolai Parlog 🇺🇦🕊️

Nicolai Parlog 🇺🇦🕊️ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @nipafx

Mar 22
#Java18 comes out later today - what can you expect from Java's newest release? Here's a 🧵 with one tweet per feature - short and sweet.

For more details and links, read this blog post: nipafx.dev/inside-java-ne…
For questions, join our #JDK18 AMA later today. 👇🏾
Pattern Matching for `switch` (2nd preview)
openjdk.java.net/jeps/420

Changes:
* constant case labels must now appear before guarded patterns of the same type
* exhaustiveness checking is now more precise when sealed classes and generics mix

Another preview is expected in #JDK19.
Vector API (3rd incubation)
openjdk.java.net/jeps/417

Changes:
* support for ARM Scalar Vector Extension (SVE)
* performance for masked ops improved on architectures that support masking in hardware

Vector API will stay incubating until Valhalla's value/primitive types.
Read 14 tweets
Dec 21, 2021
#ProjectLoom's virtual threads will make high performance in concurrent systems attainable with much simpler code. But Loom aims for even more and wants to make the code clearer and more robust by introducing *structured concurrency*.

Here's what that's all about. 🧵
Important: This is about concurrency, not parallelism. See yesterday's thread 👇🏾 for a more detailed distinction, but the gist is that concurrency is about processing lots of tasks that the environment throws at your system at the same time, ideally with high throughput.
Concurrency code is often unstructured:

* splitting and joining concurrent subtasks in different methods/classes
* little support to compose error-handling, cancellation, … across subtasks
* threading structure is opaque to the runtime, which only sees independent threads
* …
Read 9 tweets
Dec 20, 2021
What's it called when multiple threads execute at the same time? Parallelism? Concurrency? 🤔 Is there a difference? (Spoiler: Yes!)

Let me explain in a few tweets, ripping off @pressron's #InsideJava blog post "On Parallelism and Concurrency". 🧵

inside.java/2021/11/30/on-…
Parallelism:
Taking a task and splitting it up, so multiple CPUs can compute partial solutions in parallel to solve the task in less wall-clock time.

Concurrency:
Having a number of tasks that need to be arranged in a way that solves as many of them per $time_unit as possible.
Some parallelizable tasks:

* sorting an array
* inverting a matrix
* rendering graphics

Some examples for concurrency:

* processing incoming web requests
* making outbound calls to DB and/or other web services
* observe file system for changes
Read 11 tweets
Dec 10, 2021
I'm no security expert and don't know how ubiquitous this vulnerability is, but if you use Log4J 2.x, you should probably update to 2.15.x and read these:

logging.apache.org/log4j/2.x/secu…
lunasec.io/docs/blog/log4…
Here's something else you can do until the updates are rolled out.
The other option until you've updated your dependency is this command line flag.
Read 4 tweets
Nov 3, 2021
From compact record constructors to pattern matching, from generic wildcards to chaining predicates and comparators, from jpackage to jlink - here are 11 #Java tricks handpicked from dev.java. 🧵

(Musical version of this thread: )

0/11
A #record's *canonical* constructor has one arg per component but in its *compact* form, you don't have to list them. You also don't have to (in fact, can't) assign fields, just do the checks/reassignments you need, rest happens automatically.

More: dev.java/learn/using-re…

1/11
Serialization works great with #records, no black magic needed! The guaranteed presence of constructor parameters and accessors makes serialization work with the object model and makes it easy to create reliable serializable records.

More: dev.java/learn/using-re…

2/11
Read 12 tweets
Mar 16, 2021
Here are 11 improvements you get when updating to #Java16 later today: from records and type patterns to `Stream`-additions and Unix domain sockets, from creating installers to more performance and observability. 🧵👇🏾

(Longer form with tons of links: nipafx.dev/java-16-guide/)
#1 Records

Express in a single line that a type is just a collection of data without need for encapsulation and let the compiler do the rest:

record Range(int low, int high) { }

That results in almost the same API as the attached class. *drops mic* Image
#2 Type Pattern Matching

This is actually two-for-one:

* first step into pattern matching
* type patterns with `instanceof`

With a type pattern you check whether a variable is of a certain type and, if so, create a new variable of that type, so you can use it without casting. Image
Read 14 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(