executors
I need clarification on the ThreadpoolExecutor beforeExecute and afterExecute hooks
I am using threadpools in my application. I have subclassed the TreadPoolExecutor and overriden the methods beforeExecute, afterExecute and terminated for statistical purposes.[详细]
2023-04-11 18:01 分类:问答Producer Consumer - Using Executors.newFixedThreadPool
My understanding of a Producer-Consumer pattern is that it could be implemented using a queue shared between the producer and the consumer. Producer submits work to a shared queue, consumer retrieves[详细]
2023-03-27 18:12 分类:问答How to get to FutureTask execution state?
I have a singleThreadExecutor in order to execute the tasks I submit to it in serial order i.e. one task after another, no parallel execution.[详细]
2023-03-24 21:01 分类:问答Executors threads not terminating
I am using Executors.newFixedThreadPool(100) method. Single command execution needs approx 20 threads. After executing the command 5-6 times, application stops responding.[详细]
2023-03-11 04:55 分类:问答Why can't I construct a ThreadPoolExecutor backed by a DelayQueue?
I\'m trying to create a ThreadPoolExecutor: // Thingy implements Delayed and Runnable ExecutorService executor = new ThreadPoolExe开发者_StackOverflow中文版cutor(1, 1, 0l, TimeUnit.SECONDS, new Delay[详细]
2023-02-15 11:03 分类:问答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 分类:问答Executors run longer than timeout value
Here is a code segment of scala.I set timeout as 100 mills. Out of 10000 loops, 106 of them ru开发者_开发问答n more than 100 mills without throwing exceptions. The largest one is even 135 mills. Any r[详细]
2023-01-18 04:40 分类:问答Help with java threads or executors: Executing several MySQL selects, inserts and updates simmultaneously
I\'m writing an application to analyse a MySQL database, and I need to execute several DMLs simmultaneously; for example:[详细]
2023-01-02 10:43 分类:问答how do FutureTasks and CachedThreadPool work
I currently have code that does the following: private final static ExecutorService pool = Executors.newCachedThreadPool();[详细]
2022-12-22 13:45 分类:问答