ThreadPoolExecutor原理浅析及任务队列中的任务在何时通过何种方式被执行
最近在学习Java线程池,在阅读ThreadPoolExecutor的源码过程中,一直有个疑问,即线程池等待队列中的任务是如何被调起执行的呢?接下来从ThreadPoolExecutor的execute()方法开始一步步分析其原理。execute()方法// 存放线程池的运行状态 (runState) 和线程池内有效线程的数量 (workerCount)private final AtomicInteger ctl = new AtomicInteger(ctlOf(RUNNING, 0));




