You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by fe...@gmail.com on 2006/02/13 23:17:15 UTC

[mina] Synchronization question

As I can read in the FAQ:

> Do I need to make IoHandler and ProtocolHandler thread-safe? 
> You don't need to do because all events generated by MINA are transmitted to your handlers in order, and the newer event
> is not processed if the event handler method for the older event for the same session didn't return yet because MINA uses
> leader-followers thread pool by default.

Ok, and does that work for the same session only? When I manage multiple sessions must I do my own synchronizations between events on different sessions?

Re: [mina] Synchronization question

Posted by Trustin Lee <tr...@gmail.com>.
Hi Fedechicco,

On 2/14/06, fedechicco@gmail.com <fe...@gmail.com> wrote:
>
>  As I can read in the FAQ:   > Do I need to make IoHandler and
> ProtocolHandler thread-safe? > You don't need to do because all events
> generated by MINA are transmitted to your handlers in order, and the newer
> event > is not processed if the event handler method for the older event
> for the same session didn't return yet because MINA uses >
> leader-followers thread pool by default.
>
> Ok, and does that work for the same session only? When I manage multiple
> sessions must I do my own synchronizations between events on different
> sessions?
>

You have to synchronize the access to the resource shared by multiple
sessions. Except that, you're safe even if you don't synchronize it.

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