Top "Executorservice" questions

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

Java executors: wait for task termination.

I need to submit a number of task and then wait for them until all results are available. Each of …

java multithreading concurrency executorservice
Elegantly implementing queue length indicators to ExecutorServices

Why, oh why doesn't java.util.concurrent provide a queue length indicators for its ExecutorServices? Recently I found myself doing …

java concurrency queue executorservice executor
Java - splitting work to multiple threads

I am posed with the following problem: I need to split work across multiple threads for perfomance reasons, but I …

java multithreading executorservice
How to pause/resume all threads in an ExecutorService in Java?

I submitted bunch of jobs to an executorservice in Java and I somehow want to temporarily pause all these jobs. …

java multithreading concurrency parallel-processing executorservice
Thread.join() equivalent in executor

I have a newbie question. I have this code: public class Main { public static void main(String[] args) throws InterruptedException { // …

java multithreading executorservice
Removing all queued tasks of an ThreadPoolExecutor

i have this rather simple question about the ThreadPoolExecutor. I have the following situation: I have to consume objects from …

java multithreading threadpool executorservice executor
Controlling Task execution order with ExecutorService

I have a process which delegates asynch tasks to a pool of threads. I need to ensure that certain tasks …

java concurrency executorservice
ExecutorService's surprising performance break-even point --- rules of thumb?

I'm trying to figure out how to correctly use Java's Executors. I realize submitting tasks to an ExecutorService has its …

java performance executorservice
How to unit test a code snippet running inside executor service, instead waiting on Thread.sleep(time)

How to unit test a code that is running in executor service? In my situation, public void test() { Runnable R = …

java unit-testing executorservice
ScheduledExecutorService one thread many tasks

I am new to ExecutorService and wonder why following code prints correctly "10 15", even though I have created only one thread …

java multithreading timer executorservice scheduledexecutorservice