houzhanbin wrote:
hi,all
Is there a race condition in ExecutorFilter?
I am using mina-2.0.0-M4. Mina creates an processor pool for
IoService,the element in the pool is processor instance.
one instance of processor has sessions and one processor thread. the
thread run method is a loop of selector. one ExecutorFilter thread
will be executed when actions are fired up like messageReceived.
the question is whether the messageReceived will be executed in two
ExecutorFilter threads? I think the processor thread could trigger two
threads for the same session to execute the ExecutorFilter method.
thanks for your reply.
The first thing I would say is that you should consider not using an
executor filter. This is not necessarily a good things, unless you have
a very costly processing. IoProcessor are already handling the load for you.
Now, if you want to use an executor filter, and want to be sure that
requests are used sequentially, use an orderThreadPollExecutor. I think
it will solve your issue.
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org