executorservice
using ScheduledExecutorService to start and stop timer
From my readings, it seems that ScheduledExecutorService is the right way to start and stop timers in Java.[详细]
2023-01-04 07:21 分类:问答500 Worker Threads, what kind of thread pool?
I am wondering if this is the best way to do this. I have about 500 threads that run indefinitely, but Thread.sleep for a minute when done one cycle of processing.[详细]
2022-12-31 13:41 分类:问答Techniques for modeling a dynamic dataflow with Java concurrency API
EDIT: This is basi开发者_StackOverflowcally a \"how to properly implement a data flow engine in Java\" question, and I feel this cannot be adequately answered in a single answer (it\'s like asking, \"[详细]
2022-12-31 12:42 分类:问答Bigger threadpool or additional ExecutorService when new kind of thread will run?
I have a question that is related to possible overhead of ExecutorServices in Java. The present implementation has ExecutorService A with a capacity of 5 threads.[详细]
2022-12-30 17:22 分类:问答How do I catch global exceptions?
Is there a way to catch global \"crashing\" app exceptions like objc_exception_throw, EXC_ARITHMETIC etc. in code? I need that because I want to do some things bef开发者_如何学Core the app gets killed[详细]
2022-12-29 23:23 分类:问答ExecutorService that interrupts tasks after a timeout
I\'m looking for an ExecutorService implementation that can be provided with a timeout. Tasks that are submitted to the ExecutorService are interrupted if they take longer than the timeout to run. Imp[详细]
2022-12-29 13:45 分类:问答What is the fastest cyclic synchronization in Java (ExecutorService vs. CyclicBarrier vs. X)?
Which Java synchronization construct is likely to provide the best performance for a concurrent, iterative processing scenario with a[详细]
2022-12-28 08:34 分类:问答In what cases does Future.get() throw ExecutionException or InterruptedException
My code snippet: ExecutorService executor = Executors.newSingleThreadExecutor(); try { Task t = new Task(response,inputToPass,pTypes,unit.getInstance(),methodName,unit.getUnitKey());[详细]
2022-12-27 03:11 分类:问答Limiting one of each Runnable type in ExecutorService queue
I have an Executors.newFixedThreadPool(1) that I send several different tasks to (all im开发者_Go百科plementing Runnable), and they get queued up and run sequentially correct? What is the best way to[详细]
2022-12-26 16:08 分类:问答java.util.concurrent.Future.get() not returning
I have the following Java code: final Future future = exeService.submit( new Runnable() { public void run() {[详细]
2022-12-26 01:08 分类:问答