ExecutorService is a Java object containing the managed pool of threads and capable of scheduling the submitted tasks for these threads. The scheduling strategies vary in multiple available implementations.

learn more…| top users | synonyms

0
votes
0answers
28 views

ExecutorService very slow with large for loop in java

i tried to do manipulations on files with threds pool but no luck, its very slow..this is what i tried:int chunks=Runtime.getRuntime().availableProcessors();ExecutorService service=...
-4
votes
1answer
23 views

Wait for thread to be available in the thread pool in java

I am using executorservice for thread pooling in JAVA. Is there a way wherein I can wait for thread to be available in thread pool in executor service and only continue only when there are threads ...
-2
votes
1answer
31 views

Multithreading help using ExecutorService in Java [duplicate]

I am trying to search a list of words and find the total count of all the words across multiple files.My logic is to have separate threads for each file and get the count. Finally I can aggregate ...
0
votes
3answers
47 views

Killing a thread invoked asynchronously using executor service

I am trying to implement timeout for a thread which is invoked asynchronously by executor.Process flow is like below:Thread-1: Initiates a task to run on thread-2 using below code and returns ...
0
votes
1answer
53 views

Executor service invocation within streams

I'm faced with compile-time errors when using Executor service within streams. (There are alternative ways but I wanted to check if this is possible)class Operation implements Callable<Integer>...
0
votes
3answers
44 views

ExecutorService invokeall not getting interrupted

I have following code :public class Application1 {public static void main(String[] args) {ExecutorService executorService=Executors.newFixedThreadPool(5);List<Callable&...
-1
votes
1answer
27 views

Finding the factorial using callable interface in java

package projsamples;import java.util.Collection;import java.util.List;import java.util.Scanner;import java.util.concurrent.Callable;import java.util.concurrent.ExecutionException;import java....
-1
votes
1answer
26 views

Progress Bar not showing while performing HTTP request on button click

I am executing an HTTP request on button click and I am implementing the request procedure using an ExecutorService. I have a ProgressBar that is supposed to start spinning while the request is being ...
0
votes
3answers
52 views

If a thread finishes executing its last statement, as soon as that is done, is it guaranteed to dead as if explicitly calling return?

For example take this code snippet,static volatile boolean isDone=false;public static void main(String[] args) throws InterruptedException {// I know ArrayBlockingQueue cannot take 0 as the ...
2
votes
2answers
43 views

ExecutorService specify use new thread for each submitted task

I know the point of the ExecutorService is to recycle the same thread(s), but in this case I really need to specify to use a new thread for each submitted task.Here is the initialization:...
0
votes
0answers
7 views

DocumentBuilder Exception with ExecutorService in SprintBoot

I have a problem. I am developing an application with Sprint Boot that works with threads. The first thread is responsible for listening to XML files from a specific location and moving them to ...
0
votes
3answers
55 views

How can I use ExecutorService to get results of all the tasks submitted?

I have a requirement where I have to launch 5 threads for 5 tasks and there's a specific timeout for the task to be completed. After timeout I want the results of all the tasks. How can I use ...
3
votes
0answers
33 views

Sleeping in Spring Boot thread while running a new thread with ExecutorService

I have implemented API REST using Spring Boot used for some user interfaces showing information about devices connected to the network. The API REST use in turn a DAO class that gather the information ...
2
votes
2answers
43 views

Keeping a counter with ExecutorService?

I'd like to keep a counter of executed threads, to use in the same threads that I am executing.The problem here is that although the counter increases, it increases unevenly and from the console ...
1
vote
1answer
55 views

Spring task executor and scheduler

I wasn't able to find necessary information, neither in documentation or in already existing questions here, that's why I'm creating one myself (I can't ask questions under similar posts yet).What I ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,