r/java • • Apr 14 '26

JDK 27 Structured Concurrency (Seventh Preview)

https://openjdk.org/jeps/533
64 Upvotes

35 comments sorted by

View all comments

Show parent comment

8

u/pron98 Apr 15 '26

Unlike structured concurrency, which has some deep runtime support, channels can be just a regular library. People who really want channels don't need to wait for them to be in the JDK.

2

u/Joram2 Apr 15 '26

Does Java's structured concurrency (in preview) offer any advantages to similar frameworks in other languages, in particular Golang's errgroup (https://pkg.go.dev/golang.org/x/sync/errgroup)?

3

u/pron98 Apr 15 '26

I think there are several advantages compared to errgroup, but they should be clear from the docs.

1

u/javaprof Apr 17 '26

What kind of runtime support required for it? For me it seems it's can be 99.99% library, what I'm missing?

3

u/pron98 Apr 17 '26

Two things: ScopedValue inheritance and integration with platform observability (threads' relationship with structured concurrency is recorded in the runtime and observed by thread dumps, JFR, and JVM TI).