From the course: Advanced Java: Threads and Concurrency

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

ExecutorService

ExecutorService

- [Instructor] Executor really is a higher-level abstraction in terms of creating thread pools and taking care of asynchronous execution of tasks. Executor service is a more fine-grained, low-level interface extended from the Executor interface. It has more methods and features that makes it possible to fulfill the expectations of creating and managing threads and the asynchronous execution of tasks. Taking a closer look at the Executor service, it is capable of executing a task implemented by a Runnable or a Callable. It has many methods and one is the submit method. It's the same as execute in the Executor base interface, but the difference is that it returns a Future which gives access to the status and the result of task execution. There are three Overloaded submit methods. Submit that takes in a Runnable task, submits a Runnable task for execution and returns a Future representing that task. Submit that takes in a Runnable task and a result, submits a Runnable task for execution,…

Contents