Path 4 of 4
Executors, Async and Virtual Threads
Thread pools and what happens when they fill, CompletableFuture, concurrent collections, ForkJoinPool, and virtual threads in Java 21: what they change and what they cannot.
0 / 5 lessons completed · about 140 min in total
After this path you can
Outcomes
- Size a pool and its queue, and choose a rejection policy
- Compose asynchronous work without starving a pool
- Decide where virtual threads help and where they do not
- Diagnose thread starvation from a thread dump
Lessons
- 1Executors, thread pools and rejectionHow ThreadPoolExecutor decides between a thread, the queue and rejection, why an unbounded queue hides overload, and how to find a starved pool in a thread dump.Intermediate28 min
- 2CompletableFuture and asynchronous executionWhich thread runs each stage, how to compose calls without blocking, how errors and timeouts travel, and why join() inside a pool task can stop the pool for good.Intermediate30 min
- 3Concurrent collections and ConcurrentHashMapHow ConcurrentHashMap lets many threads work at once, which of its operations are atomic, why check-then-act on it is still a race, and what the other concurrent collections are for.Intermediate28 min
- 4ForkJoinPool and work stealingHow ForkJoinPool runs split-up work on per-worker deques, what the common pool is and who shares it, and how one blocking parallel stream starves unrelated code.Advanced26 min
- 5Virtual threads in Java 21What a virtual thread is, how carriers mount and unmount it, why it helps blocking I/O only, what pinning is in JDK 21, and why the bottleneck moves to the downstream limit.Advanced28 min
Simulations and labs for this path
A simulation in the browser, then the same failure on a real JVM.