Basic Composition#
From the above image, it can be seen that newCachedThreadPool is composed of 0 core threads + Integer.MAX_VALUE maximum threads + SynchronousQueue blocking queue (where each thread has a maximum survival time of 60s).
Execution Process#
For the SynchronousQueue blocking queue, since this blocking queue can only offer an object when taking, the red box section will return false and cannot enter. At this point, it will enter the green box section for judgment (at this time, a regular thread will be started and the corresponding command will be executed using the regular thread).