I have a webservice that does multiple small calculations before returning the result. I want to use the ExecutorService provided by Executors.newFixedThreadPool() as a way to implement the Master - Worker ... |
I am fairly naive when it comes to the world of Java Threading and Concurrency. I am currently trying to learn. I made a simple example to try to ... |
When creating an FixedThreadPool Executor object in Java you need to pass an argument describing the number of threads that the Executor can execute concurrently. I'm building a service class that's ... |
I would like to implement a thread pool in Java, which can dynamically resize itself based on the computational and I/O behavior of the tasks submitted to it.
Practically, I want ... |
I'm writing a message processing application (email) that I want to have an outgoing queue. The way I've designed this is having a singleton queue class, ThreadedQueueSender, backed by an Executor ... |
I have a thread pool created using
java.util.concurrent.ThreadPoolExecutor
Is there anyway I can wait till the pool is idle? By which I mean all the threads are not running and ... |
I've a Java client which accesses our server side over HTTP making several small requests to load each new page of data. We maintain a thread pool to handle all non ... |
|
I'd like to have a ScheduledThreadPoolExecutor which also stops the last thread if there is no work to do, and creates (and keeps threads alive for some time) if there are ... |
I am working on a tutorial for my Java concurrency course. The objective is to use thread pools to compute prime numbers in parallel.
The design is based on the Sieve of ... |
I have a question that is related to possible overhead of ExecutorServices in Java.
The present implementation has ExecutorService A with a capacity of 5 threads.
- It runs threads of type
A.
- type ...
|
This is more a generic question than a specific one. I'm trying to have a multi threaded environment that stays active so that I can just submit tasks and run them. ... |
Does it make sense to use a ThreadPool with a poolsize of just 1 to basically just recycle that one thread over and over again for different uses in the application? ... |
I'm trying to write a multithreaded web crawler.
My main entry class has the following code:
ExecutorService exec = Executors.newFixedThreadPool(numberOfCrawlers);
while(true){
URL url = frontier.get();
if(url == null)
...
|
In my application, I use ExecutorService a lot for making async calls.
ExecutorService executorService = Executors.newFixedThreadPool(10);
And I shutdown the executorService only when the app (web based) shuts down. Recently when debugging ... |
Let's say I have a thread pool containing X items, and a given task employs Y of these items (where Y is much smaller than X).
I want to wait for all ... |
I'm totally new to the jsr166y library and I've written a routine using the forkjoin library that splits up a query and runs it against database replicas concurrently. I've put a ... |
I have a fixed thread pool that runs 7 concurrent threads at any time (with a queue), and I want to turn it into a scheduled thread pool that runs only ... |
Im looking for a simple object that will hold my work threads and I need it to not limit the number of threads, and not keep them alive longer than needed.
But ... |
I have been developing an individual base model. All you need to know is that individuals are born, reproduce and die. I have a GUI in which i can see these ... |
The Sun Java (1.6) ScheduledThreadPoolExecutor which is an extension of ThreadPoolExecutor internally uses an implementation of DelayQueue which is an unbounded queue. What I need is a ScheduledThreadpoolExecutor with a bounded ... |
I have a .csv file containing over 70 million lines of which each line is to generate a Runnable and then executed by threadpool. This Runnable will insert a record into ... |
In this code example, the ExecutorService is used one and allowed to go out of scope.
public static void main(String[] args)
{
ExecutorService executorService = Executors.newFixedThreadPool(3);
executorService.submit(new ...
|
I've created a pool of 4 worker threads to process some files. In the test there's about 200 of them. The thread pool version is already about 3 times faster than ... |
My Java app uses a java.util.concurrent.Executors.newCachedThreadPool() to launch a number of different threads that do different kinds of work.
Some of the threads return a value. For these, I am using ... |
Hi, i am trying to simulate a browser and trying to do probing client. which creates a default no.of threads to download the non-html resources. so when i have a set of request. i wish to reuse the threads to download the non-html resources such as images , scripts etc. i wish somebody helps. Thanks |