task « ThreadPool « 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 » ThreadPool » task 

1. How to limit a task from using all threads in a thread pool?    stackoverflow.com

I'm using a thread pool to execute tasks in the background of my application. However, some of my tasks are heavier than others. So I'd like to limit the ...

2. Impossible to cancel running task with SingleThreadExecutor    stackoverflow.com

I have class implementing Runnable:

public class Abc implements Runnable{
    public synchronized void run(){
        while(!(Thread.currentThread().isInterrupted() || someCondition())){
      ...

3. java Callable FutureTask Excecuter: How to listen to finished task    stackoverflow.com

I'm quite new to executer services. Liked doing everything myself, but I think it's time to trust these services. I want to hand by Executer a Runnable. The executer wraps that in ...

4. Thread pool that binds tasks for a given ID to the same thread    stackoverflow.com

Are there any implementations of a thread pool (in Java) that ensures all tasks for the same logical ID are executed on the same thread? The logic I'm after is if there ...

5. In pool, how to judge that all tasks are done?    coderanch.com

Can you get access to the underlying queue of commands? You could maybe check to see if it's empty. Or if you will be coding all the commands to be executed, you could make them increment a static (global) counter when they start, decrement when they end. Any time the counter is zero then all tasks are done. Make sure the ...

6. ThreadPool with different tasks    coderanch.com

Hello everyone. I have an information question. In my application the user sets the number of threads that should run a certain type of code( task). in my source code there are 2 different type of tasks that needs to be run by the ThreadPool. information saved in a database by the first task is needed in the second task. Task ...

7. Thread pools, paced and exclusive tasks    coderanch.com

I have a thread pool that I've created to handle some background processing in my app. I have three kinds of tasks that I need to run. 1. Normal task. This works correctly. 2. Paced task. This task can run concurrent with others, but can only run so often. I need it to play nice and not run multiple jobs at ...

8. Fixed Size Thread Pool which infinitely serve task submitted to it    forums.oracle.com

Hi, I want to create a fixed size thread pool say of size 100 and i will submit around 200 task to it. Now i want it to serve them infinitely i.e once all tasks are completed re-do them again and again. I want to ask you people that whether this is possible or i have to re-submit them to thread ...

9. Fixed size thread pool excepting more tasks then it should    forums.oracle.com

My understanding is that this should create a thread pool that will accept 10 tasks, once there have been 10 tasks submitted I should get RejectedExecutionException, however; I am seeing that when I execute the code the pool accepts 20 execute calls before throwing RejectedExecutionException. I am on Windows 7 using Java 1.6.0_21 Any thoughts on what I am doing incorrectly? ...

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.