I have a Netty app, where I want to have more than one threads to be writing to a channel. I was just wondering whether Channel.write is thread safe?
As you can see from the code, the ChannelOutboundBuffer.addMessage()
method itself is not thread safe. However, Writing channel is "thread safe" because netty executes the write task/method in the single I/O thread.
It's thread safe so you don't need to worry.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With