<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/structured-concurrency-in-java-structuredtaskscope-and-what-comes-after-virtual-threads-2yfxvrvbd" -->

---
title: Structured concurrency in Java: StructuredTaskScope and...
description: Structured concurrency is the next major Project Loom feature after virtual threads landed in JDK 21. Oracle engineers Alan Bateman and Victor Rudometov...
canonical: https://daily.dev/posts/structured-concurrency-in-java-structuredtaskscope-and-what-comes-after-virtual-threads-2yfxvrvbd
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Structured concurrency in Java: StructuredTaskScope and what comes after virtual threads | daily.dev
og:description: Structured concurrency is the next major Project Loom feature after virtual threads landed in JDK 21. Oracle engineers Alan Bateman and Victor Rudometov...
og:url: https://daily.dev/posts/structured-concurrency-in-java-structuredtaskscope-and-what-comes-after-virtual-threads-2yfxvrvbd
og:image: https://api.daily.dev/og/posts/2yfXVRVbd.png
og:image:alt: Structured concurrency in Java: StructuredTaskScope and what comes after virtual threads
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Structured concurrency in Java: StructuredTaskScope and what comes after virtual threads

**[Collections](https://daily.dev/sources/collections)** · 2 min read · 23 upvotes · 0 comments

## Summary

Structured concurrency is the next major Project Loom feature after virtual threads landed in JDK 21. Oracle engineers Alan Bateman and Victor Rudometov explained StructuredTaskScope at Devoxx Belgium, covering cancellation via interruption, scoped timeouts, pluggable joiners (AllSuccessfulOrThrow, AnySuccessfulOrThrow, AllUntil), exception wrapping, scope value propagation, and JSON thread dumps that preserve parent-child task relationships for easier debugging. The structured concurrency JEP is proposed to become permanent in JDK 28, with future work on a lower-level API, channels, and a structured Arena for foreign memory.

## Content

Structured concurrency is the next big piece of Project Loom after virtual threads arrived in JDK 21. Oracle's Alan Bateman and Victor Rudometov covered it in a Devoxx Belgium session, and the core idea is simple: a task and the subtasks it forks should be treated as one unit of work.

## The problem with ExecutorService and Future

Naive concurrent code built on `ExecutorService` and `Future` is hard to debug. Subtasks can outlive the code that started them, and failures in one branch don't automatically stop the others. The result is leaked resources and stack traces that don't show how tasks relate to each other.

## How StructuredTaskScope works

`StructuredTaskScope` ties a parent task and its forked subtasks together. When the scope closes, cleanup is guaranteed. That one rule makes cancellation, error handling, and observability much easier to reason about.

The session covered several pieces of the API:

- **Cancellation** works through thread interruption.
- **Timeouts** are configurable and scoped to the open/join lifecycle.
- **Joiners** are pluggable. `AllSuccessfulOrThrow`, `AnySuccessfulOrThrow`, and `AllUntil` each define when the scope is done and what it returns.
- **Exception wrapping** follows configurable strategies.
- **Scope values** propagate context implicitly to subtasks.
- **JSON thread dumps** now preserve parent-child task relationships, so you can see the task tree when debugging.

## What's next

The structured concurrency JEP is proposed to become permanent in JDK 28, after several preview releases that shaped the design. Future work includes a lower-level API meant to underpin the structured one, plus channels and possibly a structured `Arena` for foreign memory.

I like that the debugging story is part of the design rather than an afterthought. Thread dumps that show the task hierarchy solve a problem most of us have hit with plain executors.

## Questions this post answers

### What is StructuredTaskScope in Java and how does it improve on ExecutorService and Future?

StructuredTaskScope ties a parent task and its forked subtasks together as one unit of work, guaranteeing cleanup when the scope closes. Unlike ExecutorService and Future, where subtasks can outlive their parent and failures don't automatically cancel siblings, StructuredTaskScope handles cancellation via thread interruption, scoped timeouts, pluggable joiners like AllSuccessfulOrThrow and AnySuccessfulOrThrow, and configurable exception wrapping.

_Developers modernizing concurrent Java code can follow structured concurrency's progress toward JDK 28 on daily.dev._

### When is structured concurrency expected to become a permanent feature in Java?

The structured concurrency JEP is proposed to become permanent in JDK 28, following several preview releases in earlier JDK versions that helped shape the API design, including pluggable joiners, scope values, and exception wrapping strategies. It builds directly on virtual threads, which arrived as a permanent feature in JDK 21.

_Teams planning JDK upgrades can track structured concurrency's path to JDK 28 on daily.dev._

### How do JSON thread dumps help debug structured concurrency code in Java?

JSON thread dumps in structured concurrency preserve parent-child task relationships, letting developers see the full task tree when debugging instead of disconnected stack traces. This addresses a common pain point with plain ExecutorService-based code, where it's hard to tell how concurrently running tasks relate to one another after a failure.

_Developers debugging concurrent Java systems can keep tabs on tooling like this via daily.dev._

## Similar posts on daily.dev

- [JEP draft: Structured Concurrency](https://daily.dev/posts/jep-draft-structured-concurrency-xkio5cvnc) · Awesome Java Newsletter · 1 upvotes · 0 comments
- [JEP 525: Structured Concurrency \(Sixth Preview\)](https://daily.dev/posts/jep-525-structured-concurrency-sixth-preview--0p1e9yjdb) · Inside Java · 0 upvotes · 0 comments
- [Project Loom in IntelliJ IDEA: Virtual Threads, Scoped Values, and Structured Concurrency](https://daily.dev/posts/project-loom-in-intellij-idea-virtual-threads-scoped-values-and-structured-concurrency-553sohxk8) · JetBrains · 4 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java)

[View this post on daily.dev](https://daily.dev/posts/structured-concurrency-in-java-structuredtaskscope-and-what-comes-after-virtual-threads-2yfxvrvbd)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Structured concurrency in Java: StructuredTaskScope and what comes after virtual threads","url":"https://daily.dev/posts/structured-concurrency-in-java-structuredtaskscope-and-what-comes-after-virtual-threads-2yfxvrvbd","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/structured-concurrency-in-java-structuredtaskscope-and-what-comes-after-virtual-threads-2yfxvrvbd"},"datePublished":"2026-10-12T06:39:42.389Z","dateModified":"2026-10-12T06:40:18.020Z","description":"Structured concurrency is the next major Project Loom feature after virtual threads landed in JDK 21. Oracle engineers Alan Bateman and Victor Rudometov...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/32bf638c636109231e23c03afad232f8?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/32bf638c636109231e23c03afad232f8?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Collections","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Collections","logo":"https://media.daily.dev/image/upload/s--fk_6ycEi--/f_auto,q_auto/v1780996001/logos/collections?_a=BAMAMiWQ0","url":"https://daily.dev/sources/collections"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/structured-concurrency-in-java-structuredtaskscope-and-what-comes-after-virtual-threads-2yfxvrvbd","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":23},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"java","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Collections","item":"https://daily.dev/sources/collections"},{"@type":"ListItem","position":3,"name":"Structured concurrency in Java: StructuredTaskScope and what comes after virtual threads"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/structured-concurrency-in-java-structuredtaskscope-and-what-comes-after-virtual-threads-2yfxvrvbd#faq","mainEntity":[{"@type":"Question","name":"What is StructuredTaskScope in Java and how does it improve on ExecutorService and Future?","acceptedAnswer":{"@type":"Answer","text":"StructuredTaskScope ties a parent task and its forked subtasks together as one unit of work, guaranteeing cleanup when the scope closes. Unlike ExecutorService and Future, where subtasks can outlive their parent and failures don't automatically cancel siblings, StructuredTaskScope handles cancellation via thread interruption, scoped timeouts, pluggable joiners like AllSuccessfulOrThrow and AnySuccessfulOrThrow, and configurable exception wrapping. Developers modernizing concurrent Java code can follow structured concurrency's progress toward JDK 28 on daily.dev."}},{"@type":"Question","name":"When is structured concurrency expected to become a permanent feature in Java?","acceptedAnswer":{"@type":"Answer","text":"The structured concurrency JEP is proposed to become permanent in JDK 28, following several preview releases in earlier JDK versions that helped shape the API design, including pluggable joiners, scope values, and exception wrapping strategies. It builds directly on virtual threads, which arrived as a permanent feature in JDK 21. Teams planning JDK upgrades can track structured concurrency's path to JDK 28 on daily.dev."}},{"@type":"Question","name":"How do JSON thread dumps help debug structured concurrency code in Java?","acceptedAnswer":{"@type":"Answer","text":"JSON thread dumps in structured concurrency preserve parent-child task relationships, letting developers see the full task tree when debugging instead of disconnected stack traces. This addresses a common pain point with plain ExecutorService-based code, where it's hard to tell how concurrently running tasks relate to one another after a failure. Developers debugging concurrent Java systems can keep tabs on tooling like this via daily.dev."}}]}
```

