ThreadPoolExecutor使用LinkedBlockingQueue的问题

ThreadPoolExecutor使用LinkedBlockingQueue的问题
上图中,线程不自动扩展,也不报错,原因如下:
ThreadPoolExecutor使用LinkedBlockingQueue的问题
以上的是execute方法的源码,从源码中可以看到,能新建非core线程的直接原因是队列workQueue添加元素失败,因此选择不同的BlockingQueue实现类会对新建线程产生很大的影响,常用的BlockingQueue:

LinkedBlockingQueue:队列已满时会添加失败;
SynchronousQueue:如果没有其他线程在等待获取元素时会添加失败;