1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| ------ tip: 此处新建的线程池,线程数未达到核心线程数,提交的任务都通过新建线程来处理 17:01:16.617 [main] INFO com.path.ExecutorConfiguration - creating thread, thread name :pool-1-thread-1 17:01:16.691 [main] INFO com.path.ExecutorConfiguration - creating thread, thread name :pool-1-thread-2 17:01:16.754 [main] INFO com.path.ExecutorConfiguration - creating thread, thread name :pool-1-thread-3 17:01:16.818 [main] INFO com.path.ExecutorConfiguration - creating thread, thread name :pool-1-thread-4 17:01:16.882 [main] INFO com.path.ExecutorConfiguration - creating thread, thread name :pool-1-thread-5 ------ tip: 此处到达线程数量到达核心线程数,开始将任务添加到任务队列中 17:01:16.946 [main] INFO com.path.ExecutorConfiguration - add task to queue, task count:1 17:01:17.009 [main] INFO com.path.ExecutorConfiguration - add task to queue, task count:2 17:01:17.073 [main] INFO com.path.ExecutorConfiguration - add task to queue, task count:3 17:01:17.136 [main] INFO com.path.ExecutorConfiguration - add task to queue, task count:4 17:01:17.199 [main] INFO com.path.ExecutorConfiguration - add task to queue, task count:5 ------ tip: 此处任务队列满了,开始新建线程来处理新增的任务 17:01:17.263 [main] INFO com.path.ExecutorConfiguration - creating thread, thread name :pool-1-thread-6 17:01:17.324 [main] INFO com.path.ExecutorConfiguration - creating thread, thread name :pool-1-thread-7 17:01:17.388 [main] INFO com.path.ExecutorConfiguration - creating thread, thread name :pool-1-thread-8 17:01:17.452 [main] INFO com.path.ExecutorConfiguration - creating thread, thread name :pool-1-thread-9 17:01:17.516 [main] INFO com.path.ExecutorConfiguration - creating thread, thread name :pool-1-thread-10 ------ tip: 此处任务队列满了以及总线程达到最大线程数,则触发拒绝策略 17:01:17.578 [main] ERROR com.path.ExecutorConfiguration - thread pool reject task, task id :16 ------ tip: 第1~5个任务已经由最开始新建的5个线程相继处理完成 17:01:17.626 [pool-1-thread-1] INFO com.path.ExecutorConfiguration - thread name :pool-1-thread-1 , handler task id: 1 17:01:17.705 [pool-1-thread-2] INFO com.path.ExecutorConfiguration - thread name :pool-1-thread-2 , handler task id: 2 17:01:17.768 [pool-1-thread-3] INFO com.path.ExecutorConfiguration - thread name :pool-1-thread-3 , handler task id: 3 17:01:17.832 [pool-1-thread-4] INFO com.path.ExecutorConfiguration - thread name :pool-1-thread-4 , handler task id: 4 17:01:17.894 [pool-1-thread-5] INFO com.path.ExecutorConfiguration - thread name :pool-1-thread-5 , handler task id: 5 ------ tip: 第6~10个任务由于添加到任务队列,所以创建的第6~10个线程是处理第11~15个任务 17:01:18.275 [pool-1-thread-6] INFO com.path.ExecutorConfiguration - thread name :pool-1-thread-6 , handler task id: 11 17:01:18.339 [pool-1-thread-7] INFO com.path.ExecutorConfiguration - thread name :pool-1-thread-7 , handler task id: 12 17:01:18.403 [pool-1-thread-8] INFO com.path.ExecutorConfiguration - thread name :pool-1-thread-8 , handler task id: 13 17:01:18.466 [pool-1-thread-9] INFO com.path.ExecutorConfiguration - thread name :pool-1-thread-9 , handler task id: 14 17:01:18.528 [pool-1-thread-10] INFO com.path.ExecutorConfiguration - thread name :pool-1-thread-10 , handler task id: 15 ------ tip: 第1~5个创建的线程在处理完第1~5个任务后,开始去任务队列获取第6~10个任务来处理 17:01:18.639 [pool-1-thread-1] INFO com.path.ExecutorConfiguration - thread name :pool-1-thread-1 , handler task id: 6 17:01:18.718 [pool-1-thread-2] INFO com.path.ExecutorConfiguration - thread name :pool-1-thread-2 , handler task id: 7 17:01:18.781 [pool-1-thread-3] INFO com.path.ExecutorConfiguration - thread name :pool-1-thread-3 , handler task id: 8 17:01:18.844 [pool-1-thread-4] INFO com.path.ExecutorConfiguration - thread name :pool-1-thread-4 , handler task id: 9 17:01:18.908 [pool-1-thread-5] INFO com.path.ExecutorConfiguration - thread name :pool-1-thread-5 , handler task id: 10
|