executorservice
Keeping track of files being uploaded by different threads
In java, I\'m trying to write a FileManager that holds a directory of files and uploads them to other FileManagers on request. Every time an upload request comes in (through a Socket), a new thread is[详细]
2023-03-03 22:24 分类:问答Java: Force stopping of ExecutorService threads
My code: String[] torrentFiles = new File(\"/root/torrents/\").list(); if(torrentFiles.length == 0 || torrentFiles == null)[详细]
2023-03-03 22:12 分类:问答ScheduledExecutorService reuse
So, let\'s say I have the following ScheduledExecutorService: public class Foo { private ScheduledExecutorService exec;[详细]
2023-03-03 11:50 分类:问答How to name the threads of a thread pool in Java [duplicate]
This question already has answers here: Naming threads and thread-pools of ExecutorService (20 answers)[详细]
2023-02-27 06:32 分类:问答Sleeping a thread inside an ExecutorService (Java/Clojure)
I have a rather massive number of threads being created inside a clojure program: (import \'(java.util.concurrent Executors))[详细]
2023-02-19 05:42 分类:问答Using ExecutorService with a tree of tasks to perform
We had a bit of a problem. :) We want to ensure that only N threads are doing background tasks at any time.To do this, we used a fixed thread pool executor.It seemed to be working fine.[详细]
2023-02-15 18:04 分类:问答How can I implement or find the equivalent of a thread-safe CompletionService?
I have a simple web service running inside a Tomcat container, which by nature is multi-threaded. In each request that comes into the service, I want to make concurrent calls to an external service. T[详细]
2023-02-11 06:19 分类:问答What's the difference between Future and FutureTask in Java?
Since use ExecutorService can submit a Callable task and return a Future, why need to use FutureTask to wrap Callable task and use the method execute? I feel they both do the same thi开发者_开发问答ng[详细]
2023-02-09 22:26 分类:问答CountdownLatch combine await(maxTime) and countdown()
I have several threads running for an almost infinite time and number of iteration. The iteration count being reset to 0 when a best solution has been found. A max number of iteration is set to preven[详细]
2023-02-09 02:44 分类:问答Stop a periodic task from within the task itself running in a ScheduledExecutorService
Is there a nice way to stop the repetition o开发者_如何学Cf task from within the task itself when running in a ScheduledExecutorService?[详细]
2023-02-09 00:02 分类:问答