I've been looking into the updates on Structured Concurrency since it's been in the works for quite some time now. I came across some information that suggests there will be significant improvements in Java 25. There's a link to an article discussing the new StructuredTaskScope API that I'd like to share. Can anyone give me insights into the current state of Structured Concurrency and what we can expect with the upcoming release?
3 Answers
Structured concurrency has been in preview for a while now, bringing a mix of excitement and sarcasm. It's like waiting for the next big thing in tech! Several notable advancements will keep the design space complexity in mind, and quality does take time. Let's just keep trying out the previews and sharing feedback to help it along.
Right? It’s been teased so long that I feel like I’ve grown old waiting for a stable release!
I was really hoping this would be fully released in Java 25 because the changes could greatly impact frameworks. But it looks like we might be waiting for the next LTS version. Fingers crossed that it won’t take too long!
Don't forget that OpenJDK doesn't really follow the LTS concept in a traditional sense.
True, but remember the features released in earlier versions didn't always wait for LTS either. Hope is not lost!
One of the biggest issues has been how declared exceptions are handled, especially with ForkJoinPool and Streams. The new updates wrap exceptions thrown by subtasks in a FailedException, and you can check the cause using a switch or instanceof. This might create a bit more consistency in how concurrency behaves like regular procedural tasks, despite changing how exceptions are propagated.
Got it! But how would you apply generics for exception handling in this scenario?
I see your point. It’s nice to have custom exception handling through a Joiner too.
Exactly! The longer it stays in preview, the more feedback they require. It's all about actual user experiences, not just theory.