Milestone events in a growing thread pool

M22a) core threads all busy
M22) start queuing

M33a) queue full
M33) create first thread beyond core threads

M44) 1st rejected task

As shown above, task queue has a max size; thread pool has a core size and max size.
P194 [[Java threads]] has a good illustration of these milestones in a “bounded pool” i.e. a pool with bounded queue. Here’s my modified version based on P194
* Pool starts with no thread no task
* First task -> create first thread
* tasks come in a flurry -> M22
* Queue full -> M33
* Pool capacity reached -> M44

How about an unbounded pool? M33 never happens.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s