Structured Concurrency in Action
Java, Concurrency, Scaling
Key Takeaways
- How virtual threads enable the thread-per-task programming model while scaling to large numbers of concurrent tasks.
- Understanding the principles of structured concurrency and how it simplifies concurrent application design.
- Using Java's
StructuredTaskScopeto manage concurrent subtasks, results, errors, and timeouts. - How structured concurrency improves readability, maintainability, and correctness compared to traditional concurrency approaches.
- Building applications where concurrent workflows naturally compose across multiple layers without explicit coordination.
Target Audience
- Software developers interested in modern concurrency patterns in Java.
- Architects looking to build scalable applications while maintaining clean and understandable code.
- Java developers who want hands-on experience with virtual threads and structured concurrency.
Requirements
- Proficiency in Java 8 or later.
- Basic understanding of concurrent programming concepts.
- A laptop with Git, Java 25, Maven, and a preferred editor or IDE installed.
- A GitHub account.
Duration
2 hours
Schedule
Workshop Plan
Introduction to Modern Java Concurrency (20 min)
- Challenges of traditional thread management.
- Why Java introduced virtual threads.
- Understanding the thread-per-task model.
Working with Virtual Threads (35 min)
- Creating and managing virtual threads.
- Comparing platform threads and virtual threads.
- Exploring scalability and performance considerations.
Structured Concurrency in Practice (45 min)
- Principles and benefits of structured concurrency.
- Using
StructuredTaskScopeto coordinate concurrent work. - Managing results, failures, cancellations, and timeouts.
- Hands-on exercises with concurrent workflows.
Composition Patterns and Real-World Applications (15 min)
- Composing concurrent tasks across application layers.
- Common patterns and anti-patterns.
- Applying structured concurrency in production systems.