threadpool « concurrency « Java Thread Q&A

Home
Java Thread Q&A
1.concurrency
2.Development
3.Exception
4.Notify
5.Operation
6.Socket
7.State
8.synchronize
9.Thread Safe
10.ThreadPool
Java Thread Q&A » concurrency » threadpool 

1. Can a java fixedThreadPool be used by multiple threads    stackoverflow.com

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 ...

2. Java Threading Tutorial Type Question    stackoverflow.com

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 ...

3. Resonable number of threads for thread pool in Java    stackoverflow.com

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 ...

4. Design considerations for an adaptive thread pool in Java    stackoverflow.com

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 ...

5. Java email sending queue - fixed number of threads sending as many messages as are available    stackoverflow.com

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 ...

6. How to Tell if a Thread Pool is Idle in Java    stackoverflow.com

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 ...

7. Best way to configure a Threadpool for a Java RIA client app    stackoverflow.com

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 ...

8. ScheduledThreadPoolExecutor and corePoolSize 0?    stackoverflow.com

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 ...

9. Recursively adding threads to a Java thread pool    stackoverflow.com

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 ...

10. Bigger threadpool or additional ExecutorService when new kind of thread will run?    stackoverflow.com

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 ...

11. java thread pool keep running    stackoverflow.com

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. ...

12. Java ThreadPool with poolsize of 1    stackoverflow.com

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? ...

13. Java ThreadPool usage    stackoverflow.com

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)
 ...

14. "Refreshing" a fixed size thread pool when using for a ExecutorService    stackoverflow.com

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 ...

15. Waiting for a subset of threads in a Java ThreadPool    stackoverflow.com

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 ...

16. Java ForkJoin Future seems to finish prematurely    stackoverflow.com

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 ...

17. Java difference between fixed threadpool and scheduled threadpool    stackoverflow.com

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 ...

18. a "simple" thread pool in java    stackoverflow.com

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 ...

19. java parallelisation problem - parallelisation is as slow as serialisation    stackoverflow.com

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 ...

20. What is best way to have Bounded Queue with ScheduledThreadPoolExecutor?    stackoverflow.com

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 ...

21. How can a threadpool be reused after shutdown    stackoverflow.com

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 ...

22. Why doesn't this thread pool get garbage collected?    stackoverflow.com

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 ...

23. Persistent Variables in ExecutorService (Java)    stackoverflow.com

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 ...

24. Do I need to do a future.get() on a Future that doesn't return a value that I care about?    stackoverflow.com

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 ...

25. Concurrent ThreadPool and reusing the finished threads    forums.oracle.com

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

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.