Flavors of Concurrency in Java
summary
Compares five concrete JVM solutions for a single “query many search engines and return the fastest reply” problem and shows code for each: raw Threads, Executors/CompletionService, ForkJoin/parallelStream, CompletableFuture. Demonstrates gotchas: parallelStream uses the JVM common ForkJoin pool and blocks whole pool on network I/O unless managed via ManagedBlocker; CompletableFuture composes asynchronous steps but can still exhaust threads; Akka actors scale to millions of lightweight entities; Quasar fibers use bytecode instrumentation to suspend stacks and enable huge concurrency; STM offers atomic in-memory transactions.
AI-written summary · about
chapters (26)
- 0:00Intro
- 2:13REVOLUTIONARY DEVELOPER TOOLS
- 3:01WHY DO WE CARE?
- 5:16CONCURRENCY PARALLELISM
- 8:26THEORY
- 8:42PRACTICE
- 12:08WHY THREADS
- 13:30COMMUNICATION
- 16:56PROBLEM ORIENTED PROGRAMMING
- 21:42TAKEAWAY: THREADS
- 23:18THREAD POOLS
- 28:32CONCERNS: EXECUTORS
- 29:48TAKEAWAY: EXECUTORS
- 30:53FORK JOIN FRAMEWORK
- 36:26TAKEAWAY: FORK JOIN POOL
- 37:15COMPLETABLE FUTURES
- 39:23Using types
- 42:46ACTOR SYSTEM
- 43:36TYPED ACTORS
- 44:03TAKEAWAY: ACTORS
- 46:04QUASAR FIBERS
- 48:11TAKEAWAY: FIBERS
- 48:45TRANSACTIONAL MEMORY
- 50:01TAKEAWAY: TX MEMORY
- 50:30CONCLUSION
- 51:32Find me and chat with me!
related talks
50mFlavors of Concurrency in Java
48mParallel Streams, CompletableFuture, and All That: Concurrency in Java 8
28mBack to the CompletableFuture: Concurrency
02h 35mParallel and Asynchronous Programming with Streams and CompletableFuture
55mBack to the CompletableFuture: Concurrency in Action
34mConcurrency in Spring Boot Applications: Making the Right Choice
52mNew Concurrency Utilities in Java 8
46mTour d’horizon de la gestion de la concurrence dans différents langages
