You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Michael Bauroth <mi...@falcom.de> on 2007/07/09 09:11:09 UTC

Synchronization in messageReceived required?

Hi,

is it required to synchronize own method invocations from within the 
messageReceived method (IoHandlerAdaptor, DemuxingIoHandler) or are they 
already synced.

Best Regards
Michael


Re: Synchronization in messageReceived required?

Posted by Michael Bauroth <mi...@falcom.de>.
Hi Maarten,

part b) was what I'm looking for. Thank you once more.

Best Regards
Michael

Maarten Bosteels schrieb:
> Hi Michael,
> 
> Please provide more details ? What do you mean with "own method 
> invocations"
> ?
> Please note that
> a) mina will not call messageReceived concurrently for the same IoSession
> b) IoHandler.messageReceived could be called concurrenlty for multiple
> IoSessions
> so if your accessing some shared state from within your messageReceived
> implementation,
> you need to provide proper synchronization.
> 
> Maarten


Re: Synchronization in messageReceived required?

Posted by Maarten Bosteels <mb...@gmail.com>.
Hi Michael,

Please provide more details ? What do you mean with "own method invocations"
?
Please note that
a) mina will not call messageReceived concurrently for the same IoSession
b) IoHandler.messageReceived could be called concurrenlty for multiple
IoSessions
so if your accessing some shared state from within your messageReceived
implementation,
you need to provide proper synchronization.

Maarten

On 7/9/07, Michael Bauroth <mi...@falcom.de> wrote:
>
> Hi,
>
> is it required to synchronize own method invocations from within the
> messageReceived method (IoHandlerAdaptor, DemuxingIoHandler) or are they
> already synced.
>
> Best Regards
> Michael
>
>