摘要: This Java tutorial is to learn about the concurrent collection SynchronousQueue. It is an implementation of BlockingQueue. Among all Java concurrent c 阅读全文
posted @ 2018-08-22 10:23 有爱jj 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 上一篇文章指出,ThreadPoolExecutor执行的步骤如下: 向线程池中添加任务,当任务数量少于corePoolSize时,会自动创建thead来处理这些任务; 当添加任务数大于corePoolSize且少于maximmPoolSize时,不再创建线程,而是将这些任务放到阻塞队列中,等待被执 阅读全文
posted @ 2018-08-22 07:52 有爱jj 阅读(749) 评论(0) 推荐(0) 编辑
摘要: 线程池技术在并发时经常会使用到,java中的线程池的使用是通过调用ThreadPoolExecutor来实现的。ThreadPoolExecutor提供了四个构造函数,最后都会归结于下面这个构造方法: 这些参数的意义如下: corePoolSize:该线程池中核心线程数最大值 maximumPool 阅读全文
posted @ 2018-08-22 07:45 有爱jj 阅读(526) 评论(0) 推荐(0) 编辑