Top "Executorservice" questions

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

How to decide whether to use newCachedThreadPool or newFixedThreadPool?

I am working on a project in which I need to make sure each thread is working on a particular …

java multithreading executorservice
Java Thread Pools/Executor Service and wait()s - what happens to the threads & task queue?

I've looked around but haven't found an answer so I wanted to confirm this for certain. Say I have a …

java multithreading concurrency threadpool executorservice
ThreadPool does not run tasks in sequence

I am using the Executor framework specifically Executors.newCachedThreadPool(); I have a list of Runnables e.g. 100. The first 50, each …

java multithreading executorservice executor
How to use ExecutorService with Android AsyncTask?

I need to execute a number of AsyncTasks and then gather all their results, consolidate and then return the final …

android multithreading asynchronous android-asynctask executorservice
Abort countDownLatch.await() after time out

I am using an ExecutorService to implement a 3-thread pool, and CountDownLatch to monitor the completion of all threads, for …

java multithreading executorservice executors
How to properly shutdown java ExecutorService

I have a simple java ExecutorService that runs some task objects (implements Callable). ExecutorService exec = Executors.newSingleThreadExecutor(); List<CallableTask&…

java multithreading executorservice shutdown
Java ExecutorService: awaitTermination of all recursively created tasks

I use an ExecutorService to execute a task. This task can recursively create other tasks which are submitted to the …

java multithreading concurrency executorservice
How to wait for list of `Future`s created using different `ExecutorServices`

Ok, so I know the first answer / comment here will be "use one ExecutorService and use invokeAll". However, there is …

java concurrency executorservice future
Default ForkJoinPool executor taking long time

I am working with the CompletableFuture for async execution of a stream generated from a list source. so i am …

java-8 executorservice threadpoolexecutor completable-future forkjoinpool