Hi Trevor, On 6/23/06, Trevor McCullough <[EMAIL PROTECTED]> wrote:
Hi, I have developed a Server using MINA 0.9.3 and would like to change the thread model. Currently my IoHandler is called by multiple threads, but each thread is associated with a unique IoSession and so I can't simultaneously handle multiple client requests received over the same IoSession. My clients (who I have no control over) tend to create a single connection and batch requests over it - so I would like to have multiple threads active for a single IoSession.
Got it. Can you advise on the best way to achieve this with MINA? You need to implement your own IoFilter. We provide a leader-followers thread pool by default, and that's why only one message per session is processed at the same time. Please refer to our code that implements the l-f thread pool and implement your own thread pool filter. The recent ThreadPoolFilter has a pluggability of thread pool implementations. This feature is not released yet, so you need to check out the latest code from our source code repository. Using that code, you only need to implement a ThreadPool interface. Also is the IoSession class thread safe e.g. if I make this change I can
multiple threads simultaneously invoking methods on the same IoSession?
Sure, it is. If not, please let us know to fix it. Was there any other issues you encountered? We're very open to your feedback. 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
