[netty-users] write() method on channels ordered?

Trustin Lee trustin at gmail.com
Fri Nov 14 14:40:12 EST 2008


Yes, Channel.write() is guaranteed to be thread safe, and therefore it can be
called from other threads directly simultaneously.  It just works because
each Channel maintains a queue of the write requests you've made internally. 
You don't need to maintain the queue by yourself.

Does my explanation answer your question? :)

HTH,
Trustin


Cuper wrote:
> 
> I was also confused about how to use netty in my client app. I didn't know
> the best way to write message outside I/O thread. Is Channel.write()
> guaranteed to be thread-safe and can be used in other threads directly? Or
> should I maintain my own send queue and invoke the write process in
> channelInterestChanged?
> 


-----
Trustin Lee, Principal Software Engineer, JBoss, a division of Red Hat
--
what we call human nature is actually human habit
--
http://gleamynode.net/
-- 
View this message in context: http://n2.nabble.com/write%28%29-method-on-channels-ordered--tp1476144p1499892.html
Sent from the Netty User Group mailing list archive at Nabble.com.




More information about the netty-users mailing list