java多线程---------java.util.concurrent并发包----------ThreadPoolExecutor

2021-07-14 07:05

阅读:382

标签:reject   并发包   run   并发   executor   pool   rdo   style   线程   

ThreadPoolExecutor线程池

一、三个构造方法

  ThreadPoolExecutor(int corePoolSize,int MaxmumPoolSize,long KeepAliveTime,,TimeUnit  unit,BolokingQueue workQueue)

   ThreadPoolExecutor(int corePoolSize,int MaxmumPoolSize,long KeepAliveTime,,TimeUnit  unit,BolokingQueue workQueue,RejectExceptionHandler handler)

  ThreadPoolExecutor(int corePoolSize,int MaxmumPoolSize,long KeepAliveTime,,TimeUnit  unit,BolokingQueue workQueue,ThreadFactory threadFactory)

  ThreadPoolExecutor(int corePoolSize,int MaxmumPoolSize,long KeepAliveTime,,TimeUnit  unit,BolokingQueue 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 

  

java多线程---------java.util.concurrent并发包----------ThreadPoolExecutor

标签:reject   并发包   run   并发   executor   pool   rdo   style   线程   

原文地址:https://www.cnblogs.com/hanxue112253/p/9539621.html


评论


亲,登录后才可以留言!