Executor ExecutorService and Thread pools
suggest changeVersions
The java.util.concurrent executor types were added in Java SE 5.
Introduction
The Executor interface in Java provides a way of decoupling task submission from the mechanics of how each task will be run, including details of thread use, scheduling, etc. An Executor is normally used instead of explicitly creating threads. With Executors, developers won’t have to significantly rewrite their code to be able to easily tune their program’s task-execution policy.
Remarks
Pitfalls
- For
scheduleAtFixedRateandscheduleWithFixedDelay, if one execution throws an exception, later executions are suppressed. SeeScheduledExecutorService.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents