On 9/28/07, tiandike <[EMAIL PROTECTED]> wrote:
>
> as you said "For an application with a ProtocolCodecFilter implemetation and
> a
> usual IoHandler implementation with database operations, I'd suggest
> you to add the ExecutorFilter after the ProtocolCodecFilter
> implementation. "
>
> do you mean:
>
> cfg.getFilterChain().addLast(
>                 "codec",
>                 new ProtocolCodecFilter(new TextLineCodecFactory(Charset
>                         .forName("UTF-8"))));
>
> cfg.getFilterChain().addLast("threadPool", new
> ExecutorFilter(Executors.newCachedThreadPool()));
>
> ??
>
> if i put ExecutorFilter before ProtocolCodecFilter  , do it has the same
> effect?

No.  ExecutorFilter is usually put after ProtocolCodecFilter, because
it is often optimal for a codec code to run in the same thread with
the I/O thread.

Adding an ExecutorFilter before ProtocolCodecFilter, your codec code
runs in a different thread from the I/O threads.

HTH,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Reply via email to