Hi Netty-users and experts,
I have a question about the write ordering in netty.
// The following all happens in one thread.
channel.writeAndFlush(msg1);
channel.writeAndFlush(msg2);
Is it guaranteed that msg2 will be written after msg1?
4.0 release notes mentioned about this and stated that the ordering are not well-defined if we mix event-loop thread and other threads. But what if I all invoke the writeAndFlush in one thread (not the event-loop thread)?
What if I do the following in one thread?
channel.eventloop().submit(new runnable() {
public void run() {channel.writeAndFlush(msg1);}
}
channel.eventloop().submit(new runnable() {
public void run() {channel.writeAndFlush(msg2);}
}
Thanks a lot.
Pei Sun