<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Structured Concurrency on JAVAPRO International</title><link>https://javapro-en.svenruppert.com/tags/structured-concurrency/</link><description>Recent content in Structured Concurrency on JAVAPRO International</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Thu, 05 Mar 2026 07:00:01 +0000</lastBuildDate><atom:link href="https://javapro-en.svenruppert.com/tags/structured-concurrency/index.xml" rel="self" type="application/rss+xml"/><item><title>Java 25 and the New Age of Performance: Virtual Threads and Beyond</title><link>https://javapro-en.svenruppert.com/java-25-and-the-new-age-of-performance-virtual-threads-and-beyond/</link><pubDate>Thu, 05 Mar 2026 07:00:01 +0000</pubDate><guid>https://javapro-en.svenruppert.com/java-25-and-the-new-age-of-performance-virtual-threads-and-beyond/</guid><description>&lt;h2 id="summary"&gt;Summary&lt;/h2&gt;
&lt;p&gt;Project Loom continues to reshape how we handle concurrency in the JVM, and Java 25 makes virtual threads more accessible to developers than ever. In this article, we’ll take a closer look at how virtual threads work, how they differ from platform threads, and where they provide the most benefit in real-world applications. We’ll also include performance benchmarks and a step-by-step guide for refactoring blocking I/O services to use virtual threads.&lt;/p&gt;</description></item><item><title>Virtual Threads, Structured Concurrency and Scoped Values: Putting it all together</title><link>https://javapro-en.svenruppert.com/virtual-threads-structured-concurrency-and-scoped-values-putting-it-all-together/</link><pubDate>Thu, 19 Feb 2026 07:00:01 +0000</pubDate><guid>https://javapro-en.svenruppert.com/virtual-threads-structured-concurrency-and-scoped-values-putting-it-all-together/</guid><description>&lt;p&gt;In this article we are going to discuss Virtual Threads, Structured Concurrency and Scoped Values, the three main features of Project Loom and see how we can put them all together, in a web application. We will create a Spring Boot application and then add these features one by one to see how these features fit together nicely enabling us to write readable concurrent programs.&lt;/p&gt;
&lt;h2 id="what-is-project-loom"&gt;&lt;strong&gt;What is Project Loom?&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Project Loom is one of the most important projects at Open JDK. The purpose of Project Loom is to provide high throughput, lightweight concurrency, which is also easy to use. It does so by providing three features: virtual threads, structured concurrency and scoped values. Virtual threads are lightweight, high-throughput threads that scale effortlessly. Structured concurrency is a streamlined approach to managing concurrent tasks as a single unit of work and scoped values are a modern alternative to &lt;code&gt;ThreadLocal&lt;/code&gt;, designed for virtual threads.&lt;/p&gt;</description></item><item><title>How To Do Structured Concurrency in Java 25</title><link>https://javapro-en.svenruppert.com/how-to-do-structured-concurrency-in-java-25/</link><pubDate>Wed, 28 Jan 2026 07:00:02 +0000</pubDate><guid>https://javapro-en.svenruppert.com/how-to-do-structured-concurrency-in-java-25/</guid><description>&lt;p&gt;It was a Friday night and we’d gone out for some drinks with a few colleagues. We ended up at one of those places where the drinks aren’t listed on the menu, so when the waiter asked us what drink we wanted we just asked if he could list a few. He was being very thorough, because he started listing all the options, and by the time he got to the 25th item some of us were like: “What was the first option again?” 🙈 We could tell he was trying to be patient, but his list recital had been for nothing and he couldn’t completely hide his disappointment. Concurrent programming with Java can sometimes be exactly like that. When you configure a few threads to do work in parallel, some of the work you let them do could potentially be for nothing. Java 25 previews a feature called ‘structured concurrency’, allowing you to prevent unnecessary work like this.&lt;/p&gt;</description></item><item><title>Java 25: Getting the Most Out of Virtual Threads with Structured Task Scopes and Scoped Values</title><link>https://javapro-en.svenruppert.com/java-25-getting-the-most-out-of-virtual-threads-with-structured-task-scopes-and-scoped-values/</link><pubDate>Tue, 23 Dec 2025 07:00:01 +0000</pubDate><guid>https://javapro-en.svenruppert.com/java-25-getting-the-most-out-of-virtual-threads-with-structured-task-scopes-and-scoped-values/</guid><description>&lt;p&gt;With Java 21, the Java platform completely reinvented how threads work by introducing &lt;em&gt;virtual threads&lt;/em&gt; alongside traditional &lt;em&gt;platform threads&lt;/em&gt;.&lt;br&gt;
Virtual threads let us create millions of concurrent tasks without worrying about creation time or memory usage. This makes it possible to handle vastly more requests than before, but it doesn’t solve every problem that once led developers to reactive programming.&lt;/p&gt;
&lt;p&gt;In this article, we’ll explore how &lt;em&gt;StructuredTaskScope&lt;/em&gt; and &lt;em&gt;ScopedValue&lt;/em&gt;, two powerful features that complement virtual threads, help us write safer, faster, and more maintainable concurrent code.&lt;/p&gt;</description></item><item><title>More Action, More Overview</title><link>https://javapro-en.svenruppert.com/more-action-more-overview/</link><pubDate>Tue, 22 Jul 2025 07:00:01 +0000</pubDate><guid>https://javapro-en.svenruppert.com/more-action-more-overview/</guid><description>Java applications have to contend with various concurrency problems. There is a solution here with new constructs.</description></item><item><title>Modern Java</title><link>https://javapro-en.svenruppert.com/modern-java/</link><pubDate>Tue, 17 Jun 2025 07:00:02 +0000</pubDate><guid>https://javapro-en.svenruppert.com/modern-java/</guid><description>&lt;p&gt;With Java&amp;rsquo;s adoption of a six-month release cycle, new features are being introduced to the language rapidly. This article will explore the latest enhancements from Java versions 21 to 24. Our focus will be on language-specific changes, excluding updates to the JVM. Additionally, we will not cover the Foreign Functions and Memory API, which serves as a modern and safer alternative to JNI.&lt;/p&gt;
&lt;p&gt;I would categorize the changes made to the language into three groups:&lt;/p&gt;</description></item><item><title>Structured concurrency</title><link>https://javapro-en.svenruppert.com/structured-concurrency/</link><pubDate>Fri, 18 Apr 2025 07:00:03 +0000</pubDate><guid>https://javapro-en.svenruppert.com/structured-concurrency/</guid><description>&lt;p&gt;Structured Concurrency was the second delivery that came out of Project Loom. It was first introduced in Java 19 as a preview API. It aimed to simplify multithreaded programming by treating multiple tasks running in different threads as a single unit of work, thereby streamlining makes the code more readable, streamlining error handling, improving reliability, and enhancing observerability.&lt;/p&gt;
&lt;p&gt;In this article, we will look at:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Look at what structured concurrency is.&lt;/li&gt;
&lt;li&gt;Look at an example using structured concurrency.&lt;/li&gt;
&lt;li&gt;Dive into the underlying API with StructuredTaskScope.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="what-is-structured-concurrency"&gt;&lt;strong&gt;What is Structured Concurrency&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Structured concurrency allows developers to reason about concurrent code by defining precise points where execution splits into multiple tasks and where those tasks subsequently merge. It brings the same level of organization to concurrency that &lt;code&gt;for&lt;/code&gt; loops and &lt;code&gt;if&lt;/code&gt; branches bring to structured programming. It achieves this by restricting the lifespan of concurrent operations to specific scopes. Similar to how variables within a &lt;code&gt;if&lt;/code&gt; statement in structured programming are bound to that block, concurrent operations within a structured scope are terminated upon exiting that scope. This ensures that threads do not linger, preventing memory leaks and wasted CPU resources.&lt;/p&gt;</description></item></channel></rss>