File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Threads and Synchronization and the fly likes CorePoolSizeVsMaxPoolSizeVsQueueSize Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "CorePoolSizeVsMaxPoolSizeVsQueueSize" Watch "CorePoolSizeVsMaxPoolSizeVsQueueSize" New topic


xcitin java

Joined: Jan 03, 2012
Posts: 1
Hi All,

Can anyone please explain in detail what is the difference between core pool size,max pool size & queue size?
What are worker threads??

thanks in advance
Prabakar Kalivaradan

Joined: Dec 12, 2011
Posts: 20

core pool size - size of the thread pool(no.of worker threads working in parallel) in normal situation
max pool size - pool size can go up to this point if thread pool is busy(means all workers are busy and more jobs are there waiting and in this situation, new workers will be created); but it always attempts to stay at core size whenever idle threads present
queue size - is the no.of jobs waiting to be processed by the worker threads; when the queue is full and all worker threads are busy, no additional jobs can be submitted to the pool

worker threads - threads that are waiting for the jobs; they keep executing the available jobs in the queue, and when there are no more jobs to be done, they sit idle, but jump to work at the first sight of any new job

Have Fun.

I agree. Here's the link:
subject: CorePoolSizeVsMaxPoolSizeVsQueueSize
It's not a secret anymore!