Executor provides an abstraction layer over all the internal thread management tasks and manages the entire concurrent execution flow of the threads. An Executor is an object that executes tasks provided.
The Java concurrency API provides the following three basic interfaces for executors:
- Executor: This is a simple interface that is used to launch a new task. It does not strictly require the execution to be asynchronous.
- ExecutorService: This is a subinterface of the Executor interface. It allows us to pass a task to be executed by a thread asynchronously. It provides methods to manage the termination of previously sublimed tasks through shutdown(), shutdownNow(), and awaitTermination(long timeout, TimeUnit unit). It also provides ...