EventLoop and EventLoopGroup
Remember the EventLoop that is assigned to the Channel is responsible to handle all the operations for the Channel. Which means whenever you execute a method that returns a ChannelFuture it will be executed in the EventLoop that is assigned to the Channel.
The EventLoop is executed by the Thread that is bound to it.
The EventLoopGroup contains a number of EventLoops and is responsible to assign an EventLoop to the Channel during its registration.
Why share the EventLoop ?
When you share the EventLoop you can be sure all Channels that are assigned to the EventLoop are using the same Thread. Remember an EventLoop is assigned to a Thread which execute the operations of it.
Because of using the same Thread there is no context-switching envolved and thus less overhead.
【9.6 Using Netty ChannelOptions and attributes】
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。