2020
09-29
09-29
Java手动配置线程池过程详解
线程池中,常见有涉及到的:ExecutorServiceexecutorService=Executors.newSingleThreadExecutor();ExecutorServiceexecutorService1=Executors.newCachedThreadPool();ExecutorServiceexecutorService2=Executors.newFixedThreadPool(3);关于Executors和ExecutorService从记忆上类似于Collections和List。但是以上几种其实不建议使用。最好可以通过自己手动配置ThreadPoolExecutor的形式。我先创建一个demo:ThreadPoolEx...
继续阅读 >