executorservice
Producer consumer request cancellation
public class MainClass { private static final int size = 5; private ExecutorService prodExec = Executors.newFixedThreadPool(size);[详细]
2023-03-29 00:41 分类:问答ExecutorService awaitTermination gets stuck
I made a fixed size thread pool with Executors.newFixedThreadPool(2), and I executed 10 Runnable objects. I set breakpoints and traced through the execution. However, fixedSizeThreadPool.awaitTerminat[详细]
2023-03-28 05:48 分类:问答How to join the main thread to a thread pool in java
Like joining two threads using join(), is there a way to join a thread to a ExecutorService object (a thread 开发者_开发问答pool) ?According to the docs, you could, from your second thread, call the s[详细]
2023-03-25 15:13 分类:问答ScheduledExecutorService multiple threads in parallel
I\'m interested in using ScheduledExecutorService to spawn mu开发者_如何学运维ltiple threads for tasks if task before did not yet finish. For example I need to process a file every 0.5s. First task st[详细]
2023-03-23 12:59 分类:问答Why does ExecutorService keep executing when threads are blocking?
I am trying to write a part of a multithreaded program where each thread from a fixed thread pool tries to fetch an object from a Queue and if the Queue is empty the thread waits.[详细]
2023-03-19 04:43 分类:问答Long computation causes ExecutorService to stop assigning new work
I am optimizing PNG files by spawning 5 pngout.exe processes to work on a directory of PNG files. Since pngout is single-threaded, this results in a large speedup. Some images take a long time to opti[详细]
2023-03-17 14:13 分类:问答Java ExecutorService to solve Recursive Fibonacci Series
I need to find out the number based on some index in the Fibonacci Series recursively using threads and I tried the following code, but the program never ends. Please let me know if I am missing somet[详细]
2023-03-17 00:50 分类:问答Elegant non-linear task scheduling?
I\'d like to schedule a task to happen frequently at first, then less frequently over time. I would prefer not to add a dependency to Quartz just for this.[详细]
2023-03-14 21:07 分类:问答How to change the name of threads in an ExecutorService? [duplicate]
This question already has answers here: Naming threads and thread-pools of ExecutorService (20 answers)[详细]
2023-03-08 03:12 分类:问答Java difference between fixed threadpool and scheduled threadpool
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 7 concurrent jobs but can queue/schedule more.[详细]
2023-03-06 10:00 分类:问答