On Apr 21, 2006, at 10:16 AM, Michael Bauroth wrote:
just a short question. In your tutorial you describe a combination of filters and ThreadPool for CPU intensive jobs. When I want to use time consuming SQL operations, would it be better to locate them in the filter / decoder part before the ThreadPoolFilter or is it equal to handle them in the IoSession.messageReceived method (don't matter)?

You want to do them after the ThreadPoolFilter. That way they will occur on separate threads, and not block the thread that reads from the nio Selector.

I'd say the general "recommended" way would be:

Processor -> ThreadPoolFilter -> {custom filters} -> ProtocolDecoderFilter -> {custom filters} -> IoHandler

.. Just do everything that could take a non-trivial amount of time after the ThreadPoolFilter :)

-pete


--
[EMAIL PROTECTED] - http://fotap.org/~osi


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to