Slide 8
Slide 8 text
createPlainPool()?
private fun createPlainPool(): ExecutorService {
val threadId = AtomicInteger()
return Executors.newFixedThreadPool(parallelism)
{
Thread(it, "CommonPool-worker-$
{threadId.incrementAndGet()}").apply { isDaemon =
true }
}
}
public static ExecutorService newFixedThreadPool(int
nThreads, ThreadFactory threadFactory) {
return new ThreadPoolExecutor(nThreads, nThreads,
0L,
TimeUnit.MILLISECONDS,
new
LinkedBlockingQueue(),
threadFactory);
}
ʂʂʂ
ʂʂʂʂʂ