Executors and Futures

Executors and futures: running tasks on a thread pool, getting results back, CompletableFuture, and shutting a pool down.

  • 9 cards
  • 5 questions
  • About 10 min
  • Intermediate to Advanced
Share

Thread pools: a fixed set of threads that run tasks from a queue, so the number of threads no longer grows with the amount of work. Creating a thread per task stops working somewhere between a hundred tasks and a hundred thousand, and shutting a pool down is the step that gets skipped and leaves a process nothing can stop. It covers ExecutorService, Runnable and Callable, Future.get(), shutdown, CompletableFuture, and choosing a pool for a workload. It leaves out the fork/join framework's internals.

Contents

9 cardsnot started