0
votes
0answers
3 views

future.get after ScheduledThreadPoolExecutor shutdown, will it work?

We use the ScheduledThreadPoolExecutor and after submitting the job we call shutdown immediately. Because as per doc Shutdown does not kill the submitted task, running task and allows it to complete. ...
0
votes
2answers
28 views

Restarting cancelled tasks in ScheduledThreadPoolExecutor

I am creating tasks with ScheduledThreadPoolExecutor and adding the Futures to a list as below in my ThreadFactory class. private static List<Future> futures; ........ ScheduledFuture sf = ...
2
votes
2answers
139 views

List all running/queued threads in ThreadPoolTaskExecutor

I use a ThreadPoolTaskExecutor in Spring to schedule my tasks. Is there a way to get a list or something of every running and queued thread of that task executor/pool?
2
votes
3answers
413 views

Grails executor plugin callAsync block always taking the same values

I'm trying to use the executor plugin in grails but I'm having a problem which I am not able to solve. Basically, i have a list of links that I want to crawl and I was having an issue where it was ...
0
votes
1answer
833 views

Java Concurrent Object Pool?

I tried to integrate an external non-thread-safe library to my web project; I found out that it's too expensive to create an instance of this object for each client thread. As a result, I would like ...
3
votes
1answer
872 views

hidden.edu.emory.mathcs.backport* [closed]

In application thread dump I can see threadpool with five threads like following: "pool-1-thread-5" prio=10 tid=0x000000000101a000 nid=0xe1f in Object.wait() [0x00007f3c66086000] ...
4
votes
2answers
575 views

(Thread pools in Java) Increasing number of threads creates slow down for simple for loop. Why?

I've got a little bit of work that is easily parallelizable, and I want to use Java threads to split up the work across my four core machine. It's a genetic algorithm applied to the traveling salesman ...
2
votes
2answers
3k views

Simple ThreadPool implementation

I want to understand logic of thread pool, and below there is a simple incorrect and not full implementation of it: class ThreadPool { private BlockingQueue<Runnable> taskQueue; public ...
1
vote
2answers
187 views

How can I make this code more concurrent?

I have a piece of code which is similar to the following: final int THREADS = 11; BlockingQueue<Future<Long>> futureQueue = new ArrayBlockingQueue<Future<Long>>(THREADS); ...
2
votes
2answers
199 views

ThreadPoolExecutor and RejectedExecutionExceptionHandler

I want to use a bounded queue for a ThreadPoolExecutor but I want to use my custom RejectedExecutionExceptionHandler. I would need to do that so that I can put rejected tasks to a separate queue and ...
0
votes
3answers
74 views

How could I integrate executors here? Or how could I improve this threading pool?

Currently I have a construct that does the following: An X number of threads (X being a configurable variable from the user) are all started and await for a task to become available. The threads block ...
1
vote
2answers
195 views

How to lazily create tasks for use by a Java thread-pool

I'm writing a load-testing application in Java, and have a thread pool that executes tasks against the server under test. So to make 1000 jobs and run them in 5 threads I do something like this: ...