ExecutionContext Demystified
summary
Describes how Scala's default ExecutionContext.global, which uses a ForkJoinPool, behaves under blocking work and why unguarded blocking drastically reduces throughput. Presents microbenchmarks comparing ForkJoinPool to Executors.newFixedThreadPool and ExecutionContext.fromExecutor, and shows that using scala.concurrent.blocking or a separate executor (plus specific configuration knobs) restores latency, fairness, and expected throughput.
AI-written summary · about
chapters (10)
- 0:00ExecutionContext intro
- 6:41Executors and interfaces
- 12:35ExecutionContext future
- 19:53Complete stack implementation
- 23:22Passing functions and params
- 27:15Global ExecutionContext
- 30:03Blocking operations config
- 35:07Automotive center context
- 37:19Blocking operations
- 40:22Summary & Q&A
related talks
04mInterview
28mBack to the CompletableFuture: Concurrency
49mTrading in Futures
51mFrom Linux Threads To ForkJoinPool
47mA Deeper Dive into Java Concurrency Updates
44mConcurrency in Scala and on the JVM
50mFlavors of Concurrency in Java
01h 01mMultithreading vs Asynchronous Programming: The Architectural Shift
