0

While writing netty application I am not sure to which thread pool should i use for my pipeline handler.

either I should go with

// OrderedMemoryAwareThreadPoolExecutor impl
    OrderedMemoryAwareThreadPoolExecutor pipelineExecutor = new OrderedMemoryAwareThreadPoolExecutor(
            200, 1048576, 1073741824, 100, TimeUnit.MILLISECONDS,
            new NioDataSizeEstimator(), new NioThreadFactory("NioPipeline"));

or

 ThreadPoolExecutor pool = new MemoryAwareThreadPoolExecutor(
     16, 65536, 1048576, 30, TimeUnit.SECONDS,
     new MyObjectSizeEstimator(),
     Executors.defaultThreadFactory());

Not sure about the difference between two.

Any help would be appreciated.

T-Bag
  • 10,916
  • 3
  • 54
  • 118

1 Answers1

1

I think it is pretty clear started in the javadocs. The OrderedMemoryAwareThreadPoolExecutor will ensure events are executed in "order" for a Channel, while MemoryAwareThreadPoolExecutor does not.

Norman Maurer
  • 23,104
  • 2
  • 33
  • 31