Executor « Operation « 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 » Operation » Executor 

1. Executor and Daemon in Java    stackoverflow.com

I have a MyThread object which I instantiate when my app is loaded through the server, I mark it as a Daemon thread and then call start() on it. The thread ...

2. Unhandled exceptions with Java scheduled executors    stackoverflow.com

I have the following issue and I would like to know what exactly happens. I am using Java's ScheduledExecutorService to run a task every five minutes. It works very ...

3. Wait for all threads in an Executor to finish?    stackoverflow.com

I'm implementing a parellel quicksort as programming practice, and after I finished, I read the Java tutorial page on Executors, which sound like they could make my code even faster. Unfortunately, ...

4. Usage of Executors.newSingleThreadScheduledExecutor    stackoverflow.com

The javadoc for

Executors.newSingleThreadScheduledExecutor 
says "... the returned executor is guaranteed not to be reconfigurable to use additional threads". What does the above sentence mean? Does it mean the returned instance may ...

5. java executor with pre-emptable thread queue    stackoverflow.com

I'm looking for a java thread-pool, that won't run more threads simultaneously than there are cores in the system. This service is normally provided by a ThreadPoolExecutor using a BlockingQueue. However, if ...

6. Graceful shutdown of threads and executor    stackoverflow.com

The following piece of code tries to accompolish this. The code loops forever and checks if there are any pending requests to be processed. If there is any, it creates a new ...

7. Multi threading with Java Executor    stackoverflow.com

I am stuck with this following problem. Say, I have a request which has 1000 items, and I would like to utilize Java Executor to resolve this. Here is the main method

public static ...

8. java Multithreading using Executor    stackoverflow.com

I have 2 classes that implement Runnable.I need to create 10 threads to execute them.I use the following code.

ExecutorService es = Executors.newFixedThreadPool(10);
  Runnable r=new TestThread1();
  Runnable r1=new TestThread2();
  ...

9. java-Executor Framework    stackoverflow.com

Please look at my following code....

  private static final int NTHREDS = 10;
  ExecutorService executor = Executors.newFixedThreadPool(NTHREDS);
  while(rs.next()){
          ...

10. Executors.newSingleThreadExecutor() - how to see how many tasks are in queue    stackoverflow.com

I am using Executors.newSingleThreadExecutor() in my code. I want to monitor number of tasks in queue to check that procesor is not overloaded with messages. How can I get a number ...

11. A good way to bulk download images over http with Java    stackoverflow.com

We have a web application that needs to import 10-20 images from a partner site via http. If I have a list of strings that represent the urls I want ...

12. Executors threads not terminating    stackoverflow.com

I am using Executors.newFixedThreadPool(100) method. Single command execution needs approx 20 threads. After executing the command 5-6 times, application stops responding. My thread is implementing Callable. I doubt, that thread doesn't terminate after ...

13. Executor thread keeps running after hot deploy    stackoverflow.com

Is there any way to know when a war is being hot deployed so I can shutdown the old executor that is running scheduled tasks? I'm using jboss 6 and ...

14. Implement Producer-Consumer Pattern Using Executor Framework    stackoverflow.com

I have two threads, a consumer and a producer. The consumer thread is the main thread while the producer thread is created by a third party library I use. You make ...

15. Executor and applets    coderanch.com

16. Multi-Thread command line executor cause uncertain result    coderanch.com

All, I have writen a Java program to execute the external program. sth like execute "cat < abc.xml" and such java program will return same result as linux command. I test the program use such way : give my program 64 same file and let it execute them. In some of the machine the task 100% completed, while in some machine ...

17. relationship between Executor and ThreadMXBean    coderanch.com

In this case, I believe it is a design issue. The MBean that monitors the threading system, monitors it at the thread system level. That is how it was designed. I guess it wouldn't be that hard to develop another mbean that gets registered when thread pools are created. You just need some experience with JMX. Henry [ December 30, 2005: ...

18. Using an executor    coderanch.com

19. Executors    coderanch.com

The Executor is good at managing the threads executing tasks when the number of tasks is higher than the number of threads. For example, if I make a fixed sized pool with 5 threads and throw 100 tasks at it, it will run "5 at once" and as each one finishes it will start a new one, so it will stay ...

20. Thread vs Executor    coderanch.com

Executors is a threadpool. Its costly to create a new thread everytime to process a task. Its effective and recommended to reuse threads if possible. Executors do just that for you. This is the basic benefit of using Executors over thread creation per task. For detailed discussions do read the book that Campbell has pointed out!

21. Executor runnable priority    coderanch.com

I'm just now digging into the threading stuff introduced in java 1.5 (Executors and such). Is there a way to tell an executor that a runnable you pass it is more or less important than another? Up till now I have been using the setPriority() method on my threads as I create them to allow more important threads to execute quicker ...

22. Executors in Threads    coderanch.com

Dear Sir, I'm trying a code using Executors implementing the Callable interface to calculate sum of Fibonacci series. I cannot understand where the mistake is. Besides i don't seem to find any ease in using them against the Thread class. Using callable makes it more tough as we can't return strings while returning Integers robbing the code of displaying user friendly ...

23. How can i get completion status of runnable object which is dispatched to executor class?    coderanch.com

hi, Thread communication problem. I have one class say A which periodically cretes runnable object of class B and put it in a queue and then it is dispatched to the executor class for thread execution. lets sat b1 is in execution and at that time new runnable object is triggered and pushed into queue named b2. b2 will be dispatched ...

25. Executor    coderanch.com

26. Any problem with using two instances of Executor service one after the other?    coderanch.com

In my code, I have two instances of of Executor Service with cached thread pools. For example, I have my service calling the runner object which implements runnable. I call runProcess method twice in a row. My question is if this is if one service will interfere with the other service. I need the threads in each service to finish one ...

28. Why thread state is still NEW after Executor excute it?    forums.oracle.com

Make your Miners and Analyzers into Runnable instead of Threads: you should almost never extend Thread! Because when you think of it, you're not creating a new type of Thread, but simply provide some code that can be run (= a Runnable). It doesn't matter if that code is run in a new Thread or not, so why should it be ...

29. Executors.newSingleThreadScheduledExecutor() creating multiple threads?    forums.oracle.com

While examining a stack trace this morning, I found approximately 250 idle threads labelled "pool-4-thread-###", where ### ranged from 1 to 250 or so. I then traced pool-4-thread to a ScheduledExecutorService and underlying ThreadPoolExecutor object created via a call to Executors.newSingleThreadScheduledExecutor(). There are two types of tasks scheduled on that instance of the Executor. The first is a task which runs ...

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.