Top "Executorservice" questions

ExecutorService is a Java object containing the managed pool of threads and capable of scheduling the submitted tasks for these threads.

What's the difference between Future and FutureTask in Java?

Since use ExecutorService can submit a Callable task and return a Future, why need to use FutureTask to wrap Callable …

java executorservice callable futuretask
Java Executors: how can I stop submitted tasks?

I have submitted a task using executors and I need it to stop after some time (e.g. 5 minutes). I …

java multithreading executorservice
How to interrupt ExecutorService's threads

When using the ExecutorService returned by Executors.newSingleThreadExecutor(), how do I interrupt it?

java multithreading concurrency executorservice
How to stop a ScheduledExecutorService?

The program finishes after nine prints: class BeeperControl { private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); public void beep() { final Runnable beeper = …

java executorservice
How to name the threads of a thread pool in Java

I have a Java application that uses the Executor framework and I have code that looks like this protected ScheduledExecutorService …

java multithreading threadpool executorservice
ExecutorCompletionService? Why do need one if we have invokeAll?

If we use an ExecutorCompletionService we can submit a series of tasks as Callables and get the result interacting with …

java multithreading concurrency executorservice java.util.concurrent
Program does not terminate immediately when all ExecutorService tasks are done

I put a bunch of runnable objects into an ExecutorService: // simplified content of main method ExecutorService threadPool = Executors.newCachedThreadPool(); for(…

java multithreading concurrency executorservice
How to catch exceptions in FutureTask

After finding that FutureTask running in a Executors.newCachedThreadPool() on Java 1.6 (and from Eclipse) swallows exceptions in the Runnable.run() …

java concurrency executorservice futuretask
Can I use Callable threads without ExecutorService?

Can I use Callable threads without ExecutorService? We can use instances of Runnable and subclasses of Thread without ExecutorService and …

java multithreading concurrency executorservice java.util.concurrent
Is ExecutorService (specifically ThreadPoolExecutor) thread safe?

Does the ExecutorService guarantee thread safety ? I'll be submitting jobs from different threads to the same ThreadPoolExecutor, do I have …

java multithreading executorservice