标签:
public
static
ExecutorService
newFixedThreadPool
(
int
nThreads) {
return
new
ThreadPoolExecutor(nThreads,
nThreads,
0L,
TimeUnit.MILLISECONDS,
new
LinkedBlockingQueue<Runnable>());
}
public
static
ExecutorService
newCachedThreadPool
() {
return
new
ThreadPoolExecutor(
0
,
Integer.MAX_VALUE,
60L,
TimeUnit.SECONDS,
new
SynchronousQueue<Runnable>());
}
public
static
ExecutorService
newSingleThreadExecutor
() {
return
new
FinalizableDelegatedExecutorService(
new
ThreadPoolExecutor(
1
,
1
,
0L,
TimeUnit.MILLISECONDS,
new
LinkedBlockingQueue<Runnable>()));
标签:
原文地址:http://www.cnblogs.com/lsx1993/p/4619973.html