I implement ChannelInboundHandlerAdapterand ask a question about concurrency. Do I need to make threads safe? I mean, I have to store a certain state for each client for my sessions.
public class Impl extends ChannelInboundHandlerAdapter{
private List<Integer> someState;
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
int size = someState.size();
}
}
The fact is that if you request a method from a request by channelReaddifferent threads, I will have to put some memory barriers.
It's necessary? Or will Nettyhe take care of this?
source
share