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 - Java Tutorial
From the course: Advanced Java: Threads and Concurrency
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
-
-
-
-
-
(Locked)
Managing thread execution: Thread pools and executors4m 3s
-
(Locked)
ExecutorService3m 55s
-
(Locked)
Implementing an executor: ExecutorService in action5m 48s
-
(Locked)
Executing tasks periodically with ScheduledExecutorService6m 22s
-
(Locked)
Challenge: Number magic and voting simulator2m 20s
-
(Locked)
Solution: Number magic and voting simulator5m 41s
-
(Locked)
-
-
-
-
-