1.执行器Excutor
newCachedThreadPool:按需创建线程
newFixedThreadPool:创建指定多个线程
newSingleThreadExcutor:创建单个线程
newScheduledThreadPool
newSingleThreadExcutor
步骤:Excutors.newCachedThreadPool();
submit()提交Runaable/Callable对象;
接收保存Future对象用以停止线程,提交Callable对象;shutDown关闭线程池;
2.ForkJoin框架