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
<http://netty.io/wiki/new-and-noteworthy-in-4.0.html#write-ordering---mix-eventloop-thread-and-other-threads>
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

-- 
You received this message because you are subscribed to the Google Groups 
"Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/netty/CAKrkhguV%2B7T97rd_0CiPZX1fwP2kMJuX2kbbzK6pohw3pJT74g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to