【发布时间】:2015-02-18 03:24:12
【问题描述】:
在编写 netty 应用程序时,我不确定应该为管道处理程序使用哪个线程池。
要么我应该去
// OrderedMemoryAwareThreadPoolExecutor impl
OrderedMemoryAwareThreadPoolExecutor pipelineExecutor = new OrderedMemoryAwareThreadPoolExecutor(
200, 1048576, 1073741824, 100, TimeUnit.MILLISECONDS,
new NioDataSizeEstimator(), new NioThreadFactory("NioPipeline"));
或
ThreadPoolExecutor pool = new MemoryAwareThreadPoolExecutor(
16, 65536, 1048576, 30, TimeUnit.SECONDS,
new MyObjectSizeEstimator(),
Executors.defaultThreadFactory());
不确定两者之间的区别。
任何帮助将不胜感激。
【问题讨论】: