线程池

线程池用来复用线程

image

 

image

 

image

 

image

 

image

 先创建自定义的runnable任务,然后创建runnable任务对象,创建线程池调用线程池.excute(),参数填任务对象

image

 

 2.executors工具类创建线程池

 

image

 threadpoolexecutor创建线程池更好

 

posted @ 2025-12-17 11:54  jokercheems  阅读(1)  评论(0)    收藏  举报