I have a question regarding possible overhead ExecutorServicein Java.
In the current implementation there is ExecutorService Aa capacity of 5 threads.
- It launches type threads
A. - Type
Astreams read and write the database.
Now the type stream Bwill be started after the completion of some type streams A.
- The number of threads
Bthat will be launched is different from time to time. - type
Bstreams run some file I / O system (rather than a database).
So i have to
- add new
ExecutorServiceto handle threadsB - or should I increase the capacity
ExecutorService Aand start the Bthread type with this too?
I think that for Java there may be additional overhead to have two ExecutorServices, but on the other hand, the total number of threads will increase anyway. Does it matter at all?
source
share