ThreadPoolExecutor线程池
一、三个构造方法
ThreadPoolExecutor(int corePoolSize,int MaxmumPoolSize,long KeepAliveTime,,TimeUnit unit,BolokingQueue<Runnable> workQueue)
ThreadPoolExecutor(int corePoolSize,int MaxmumPoolSize,long KeepAliveTime,,TimeUnit unit,BolokingQueue<Runnable> workQueue,RejectExceptionHandler handler)
ThreadPoolExecutor(int corePoolSize,int MaxmumPoolSize,long KeepAliveTime,,TimeUnit unit,BolokingQueue<Runnable> workQueue,ThreadFactory threadFactory)
ThreadPoolExecutor(int corePoolSize,int MaxmumPoolSize,long KeepAliveTime,,TimeUnit unit,BolokingQueue<Runnable> workQueue,ThreadFactory threadFactory,RejecExceptiontHandler handler,)
标注
1、CorePoolSize 线程池的基本大小
2、MaxmunPoolSize 线程池最大数量
3、KeepAliveTime 线程活动保持时间
4、BlokingQueue 任务队列 (ArrayBlokingQueue LinkedBlokingQueue synchronousQueue PriorityBlokingQueue)
5、RejectExceptionHandler 饱和策略 (AbortPlicy CallerRunsPolicy DiscardOldestPolicy DiscardPolicy)
6、ThreadFactory
原文地址:https://www.cnblogs.com/hanxue112253/p/9539621.html