Here you can find the source of getWorkerCount(ThreadPoolExecutor workerExecutor)
public static int getWorkerCount(ThreadPoolExecutor workerExecutor)
//package com.java2s; //License from project: LGPL import java.util.concurrent.ThreadPoolExecutor; public class Main { /**/*from w w w. ja v a 2 s . c om*/ * Copy of {@link org.jboss.netty.channel.socket.nio.SelectorUtil#DEFAULT_IO_THREADS} */ public static final int DEFAULT_IO_THREADS = Runtime.getRuntime().availableProcessors() * 2; public static int getWorkerCount(ThreadPoolExecutor workerExecutor) { return Math.min(workerExecutor.getMaximumPoolSize(), DEFAULT_IO_THREADS); } }