Back to the CompletableFuture: Concurrency
summary
Explains why Java moves from Threads/Runnable to ExecutorService and CompletableFuture, with concrete code patterns: use ExecutorService factories and ForkJoinPool work-stealing for thread pools, replace shared state with ConcurrentHashMap and Atomics, and avoid ThreadLocal memory leaks. Shows Fresco image pipeline and Spectrum transcoding using ConcurrentHashMap lookups, and Litho updating UI via CompletableFuture.runAsync and CompletableFuture.thenCombine plus exceptionally for error recovery. Emphasizes nonblocking chaining, controlled completion, and practical pitfalls like blocking get and exception types.
AI-written summary · about
chapters (10)
- 0:00Concurrency in Java
- 3:48From fear to admiration
- 9:02Runnable and Threads
- 11:12Java 5 concurrency API
- 15:22Future limitations
- 18:08Executor framework
- 20:56Future pitfalls
- 22:17CompletableFuture features
- 25:44Demo with Litho
- 27:10Call to action
related talks
55mBack to the CompletableFuture: Concurrency in Action
48mParallel Streams, CompletableFuture, and All That: Concurrency in Java 8
52mNew Concurrency Utilities in Java 8
47mA Deeper Dive into Java Concurrency Updates
48mCompletableFuture: The Promises of Java
50mFlavors of Concurrency in Java
56mFlavors of Concurrency in Java
45mKeynote: Where Promises Fall Short
