<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/project-loom-in-intellij-idea-virtual-threads-scoped-values-and-structured-concurrency-553sohxk8" -->

---
title: Project Loom in IntelliJ IDEA: Virtual Threads, Scoped...
description: Java's Project Loom brings three complementary features aimed at simplifying concurrent programming: Virtual Threads (JEP 444, stable since Java 21), Scoped...
canonical: https://daily.dev/posts/project-loom-in-intellij-idea-virtual-threads-scoped-values-and-structured-concurrency-553sohxk8
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Project Loom in IntelliJ IDEA: Virtual Threads, Scoped Values, and Structured Concurrency | daily.dev
og:description: Java's Project Loom brings three complementary features aimed at simplifying concurrent programming: Virtual Threads (JEP 444, stable since Java 21), Scoped...
og:url: https://daily.dev/posts/project-loom-in-intellij-idea-virtual-threads-scoped-values-and-structured-concurrency-553sohxk8
og:image: https://api.daily.dev/og/posts/553SohXK8.png
og:image:alt: Project Loom in IntelliJ IDEA: Virtual Threads, Scoped Values, and Structured Concurrency
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.

# Project Loom in IntelliJ IDEA: Virtual Threads, Scoped Values, and Structured Concurrency

**[JetBrains](https://daily.dev/sources/jetbrains)** · 14 min read · 4 upvotes · 0 comments

## Summary

Java's Project Loom brings three complementary features aimed at simplifying concurrent programming: Virtual Threads (JEP 444, stable since Java 21), Scoped Values (JEP 506, stable since Java 25), and Structured Concurrency (JEP 533, in its seventh preview in Java 27). The post walks through a real example service that fetches customer orders and recommendations in parallel, first using CompletableFuture with its problems (thread leaks, awkward error unwrapping, duplicated cancellation logic, fragile ThreadLocal context propagation), then rewritten using StructuredTaskScope, ScopedValue, and virtual threads to eliminate those issues. It also covers IntelliJ IDEA tooling support, including thread dumps showing structured concurrency scopes (from IntelliJ IDEA 2026.1), live templates for scaffolding StructuredTaskScope, and steps for configuring Java 27 early-access builds with preview features enabled in the IDE.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.jetbrains.com/idea/2026/08/project-loom-in-intellij-idea-virtual-threads-scoped-values-and-structured-concurrency>

## Questions this post answers

### What is the difference between ThreadLocal and ScopedValue in Java 25?

ScopedValue, stable since Java 25 under JEP 506, is an immutable alternative to ThreadLocal for sharing context across threads. A value is bound once within a defined scope, is automatically available to code in that scope, and is cleaned up when the scope ends; the binding cannot be mutated. ThreadLocal, by contrast, is mutable, persists for a thread's lifetime unless manually removed, and risks memory leaks since child threads inherit copies rather than references.

_daily.dev surfaces practical Java concurrency guidance for developers migrating off ThreadLocal to scoped values._

### How do I handle cancellation and errors with Java's StructuredTaskScope instead of CompletableFuture?

StructuredTaskScope removes the need for manual cancel() calls found in CompletableFuture code. When a subtask fails or a timeout expires, join() throws an ExecutionException wrapping the cause, and remaining subtasks are cancelled automatically; you can switch on the cause type (e.g. CancelledByTimeoutException) to handle each case, avoiding the duplicated cancellation logic and manual exception unwrapping required with CompletableFuture.allOf and get().

_developers refactoring parallel Java calls can track Loom-based patterns like this on daily.dev before shipping to production._

### What preview stage is structured concurrency at in Java 27 and is it production ready?

Structured concurrency (JEP 533) is in its seventh preview as of Java 27 and is not yet recommended for production use, though its broad API shape has stayed relatively stable across preview rounds. To experiment with it in IntelliJ IDEA, you need Java 27 with preview features enabled, setting the Language level to the experimental or preview option that includes structured concurrency support.

_track preview JEP progress like structured concurrency on daily.dev before betting production code on it._

## Similar posts on daily.dev

- [Virtual Threads vs. Coroutines in 2026: Is Java Finally There?](https://daily.dev/posts/virtual-threads-vs-coroutines-in-2026-is-java-finally-there--cvttfhcqg) · Codemotion · 52 upvotes · 3 comments
- [JEP draft: Structured Concurrency](https://daily.dev/posts/jep-draft-structured-concurrency-xkio5cvnc) · Awesome Java Newsletter · 1 upvotes · 0 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/project-loom-in-intellij-idea-virtual-threads-scoped-values-and-structured-concurrency-553sohxk8)

```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":"Project Loom in IntelliJ IDEA: Virtual Threads, Scoped Values, and Structured Concurrency","url":"https://daily.dev/posts/project-loom-in-intellij-idea-virtual-threads-scoped-values-and-structured-concurrency-553sohxk8","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/project-loom-in-intellij-idea-virtual-threads-scoped-values-and-structured-concurrency-553sohxk8"},"datePublished":"2026-08-28T06:41:04.794Z","dateModified":"2026-09-14T06:07:16.477Z","description":"Java's Project Loom brings three complementary features aimed at simplifying concurrent programming: Virtual Threads (JEP 444, stable since Java 21), Scoped...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8f72778f230c6907b6b41d38b65e3505?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8f72778f230c6907b6b41d38b65e3505?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"JetBrains","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":"JetBrains","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/53ecf0c676f34b3896ee109609d91efa","url":"https://daily.dev/sources/jetbrains"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/project-loom-in-intellij-idea-virtual-threads-scoped-values-and-structured-concurrency-553sohxk8","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"devtools,java","timeRequired":"PT14M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"JetBrains","item":"https://daily.dev/sources/jetbrains"},{"@type":"ListItem","position":3,"name":"Project Loom in IntelliJ IDEA: Virtual Threads, Scoped Values, and Structured Concurrency"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/project-loom-in-intellij-idea-virtual-threads-scoped-values-and-structured-concurrency-553sohxk8#faq","mainEntity":[{"@type":"Question","name":"What is the difference between ThreadLocal and ScopedValue in Java 25?","acceptedAnswer":{"@type":"Answer","text":"ScopedValue, stable since Java 25 under JEP 506, is an immutable alternative to ThreadLocal for sharing context across threads. A value is bound once within a defined scope, is automatically available to code in that scope, and is cleaned up when the scope ends; the binding cannot be mutated. ThreadLocal, by contrast, is mutable, persists for a thread's lifetime unless manually removed, and risks memory leaks since child threads inherit copies rather than references. daily.dev surfaces practical Java concurrency guidance for developers migrating off ThreadLocal to scoped values."}},{"@type":"Question","name":"How do I handle cancellation and errors with Java's StructuredTaskScope instead of CompletableFuture?","acceptedAnswer":{"@type":"Answer","text":"StructuredTaskScope removes the need for manual cancel() calls found in CompletableFuture code. When a subtask fails or a timeout expires, join() throws an ExecutionException wrapping the cause, and remaining subtasks are cancelled automatically; you can switch on the cause type (e.g. CancelledByTimeoutException) to handle each case, avoiding the duplicated cancellation logic and manual exception unwrapping required with CompletableFuture.allOf and get(). developers refactoring parallel Java calls can track Loom-based patterns like this on daily.dev before shipping to production."}},{"@type":"Question","name":"What preview stage is structured concurrency at in Java 27 and is it production ready?","acceptedAnswer":{"@type":"Answer","text":"Structured concurrency (JEP 533) is in its seventh preview as of Java 27 and is not yet recommended for production use, though its broad API shape has stayed relatively stable across preview rounds. To experiment with it in IntelliJ IDEA, you need Java 27 with preview features enabled, setting the Language level to the experimental or preview option that includes structured concurrency support. track preview JEP progress like structured concurrency on daily.dev before betting production code on it."}}]}
```

