This is the fourth session of Part 1 of the [Modern Backend] course: a lecture on "Structured Concurrency."
In this lecture, we will explore the concept and necessity of structured concurrency, provided as a preview feature (JEP 505) in Java 25, and how it addresses the problems inherent in traditional parallel processing approaches.
📌 Key topics:
- Basic concepts of parallel processing (Fork & Join, Thread Pool)
- Clear differences between concurrency and parallelism
- Three problems with existing CompletableFuture-based asynchronous/parallel processing (missing cancellation propagation, resource leaks, and fragmented exception handling)
-
Why structured concurrency is necessary in the era of virtual threads
- Lifecycle management based on code blocks using StructuredTaskScope, along with a comparative analysis with existing code
Discover the concurrency paradigm of Modern Java, which safely controls the lifecycle of asynchronous tasks within a single code block.