# ExecutorService

* ExecutorService maintains thread pool
* Executors.newCachedThreadPool()
* Executors.newFixedThreadPool()
* Execute(), submit(), invokeAny(), invokeAll()
* Runnable VS Callable
* Future.get(\*time), Future.isDone(), Future.cancel()
* Executor.shutdown()

[http://tutorials.jenkov.com/java-util-concurrent/executorservice.html](http://tutorials.jenkov.com/java-util-concurrent/executorservice.html)

## 2. Task Delegation

![](https://4018063213-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LgDoNuCXyu9aZFbMyjz%2F-LgDoR-RQNrZJsdAdhRB%2F-LgDoROqCMNj0pkoGnhT%2FTaskDelegation.png?generation=1559321758367357\&alt=media)

A thread delegating a task to an ExecutorService for asynchronous execution.
