Thank you, Norman.

On Monday, December 12, 2016 at 5:36:51 AM UTC-8, Norman Maurer wrote:
>
>
>
> On 12 Dec 2016, at 08:23, Pei Sun <[email protected] <javascript:>> 
> wrote:
>
> 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? 
>
>
> Yes it is.
>
>
> 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);}
> }
>
>
> This will still run in the Eventloop thread.
>
>
> 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] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/netty/CAKrkhguV%2B7T97rd_0CiPZX1fwP2kMJuX2kbbzK6pohw3pJT74g%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/netty/CAKrkhguV%2B7T97rd_0CiPZX1fwP2kMJuX2kbbzK6pohw3pJT74g%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
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/e1784568-0343-4c93-a3d3-10e86bcd7a53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to