executor
Is there a simple way to tell what tasks a Java Executor is running at a given moment?
I\'m sure I could hack something together which would enable me to figure this开发者_JAVA技巧 out, but I\'m hoping there\'s an out-of-the-box solution I\'m just missing. I read the docs but I didn\'t[详细]
2023-02-03 06:05 分类:问答ThreadPool does not run tasks in sequence
I am using the Executor framework specifically Executors.newCachedThreadPool(); I have a list of Runnables e.g. 100.[详细]
2023-01-31 06:31 分类:问答Why does this code not see any significant performance gain when I use multiple threads on a quadcore machine?
I wrote some Java code to learn more about the Executor framework. Specifically, I wrote code to verify the Collatz Hypothesis - this says that if you iteratively apply the following function to any[详细]
2023-01-27 07:50 分类:问答Multi threading with Java Executor
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.[详细]
2023-01-21 01:36 分类:问答Calling Looper more than once causes "sending message to a Handler on a dead thread"
I am using an Executor [fixed thread pool] with my own ThreadFactory that adds a Looper: Handler HANDLER = new Handler();[详细]
2023-01-15 07:57 分类:问答Java - what's so great about Executors?
In a life without Java Executors, new threads would have to be created for each Runnable tasks. Making new threads requires thread overhead (creation and teardown) that adds complexity and wasted time[详细]
2023-01-11 04:56 分类:问答ThreadPoolExecutor policy
I\'m trying to use a ThreadPoolExecutor to schedule tasks, but running into some problems with its policies. Here\'s its stated behavior:[详细]
2023-01-10 05:21 分类:问答ScheduledExecutorService Life Cycle?
I have an object that needs to do periodically do some work while the object itself is alive, so I designed something like the following. Basically a Main class which contains a reference to a Schedul[详细]
2023-01-09 15:01 分类:问答Java Executors: how can I set task priority?
Is there a possibility to set priority to tasks which are executed by E开发者_开发知识库xecutors? I\'ve found some statements in JCIP about it\'s possible but I cannot find any example and I cannot fi[详细]
2023-01-05 21:40 分类:问答Does this need explicit synchronization?
I have two threads, and I want to make sure I am doing the synchronization correctly on the LinkedBlockingQueue..Is this correct?Or is the explicit synchronization on (messageToCommsQueue) not necessa[详细]
2022-12-20 16:58 分类:问答