Hi,
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.
- It runs threads of type
A. - type
Athreads do some database reading and writing.
Now, a thread of type B will run after some threads of type A has finished.
- The number of type
Bthreads that will run is different from time to time. - type
Bthreads do some filesystem IO (not database).
So should I
- add a new
ExecutorServiceto handle typeBthreads - or should I increase the capacity of
ExecutorService Aand run typeBthreads with that one as well?
I'm thinking that there might be some extra overhead for Java to have two ExecutorServices, but on the other hand the total number of threads will increase either way. Does it matter at all?