java线程池(ThreadPool)
生活随笔
收集整理的這篇文章主要介紹了
java线程池(ThreadPool)
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
(1)自定義
ThreadPoolExecutor(int corePoolSize,?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? int maximumPoolSize,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? long keepAliveTime,?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? TimeUnit unit,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? BlockingQueue<Runnable> workQueue,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? RejectedExecutionHandler handler)
(2)工廠類
Executors.newCachedThreadPool()
Executors.newFixedThreadPool(int)
Executors.newSingleThreadExecutor()
總結(jié)
以上是生活随笔為你收集整理的java线程池(ThreadPool)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: android 事件传递
- 下一篇: 以480x800为标准出的标注,转换成相