On 3/24/06, Greg Duffy <[EMAIL PROTECTED]> wrote:
>
> Trustin,
>
> I did see that messageSent was being executed in a thread from the
> thread pool. I guess my question is: what is the best way to write a
> multi-threaded client? It seems like things like the protocol encoder
> (which catches filterWrite, I guess) should run in a pooled thread.


Yes, you're right.  Robert says that he modified the ThreadPoolFilter so
IoSession.write() also runs in a thread pool thread.  Let's wait for him for
a while.

Is it up to me to make sure that happens by executing session.write()
> in my own external thread pool? If so, what is the use of a thread
> pool in the IoConnector case, what operations is it speeding up (if
> not the protocol encoder)?


All events are still executed in a thread pool thread, and therefore, your
IoHandler implementation gets benefits from it.  For example, you can write
your messages in sessionOpened() method.

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Reply via email to