You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by alimli <ha...@gmail.com> on 2007/08/02 12:21:43 UTC

IoSession User-Defined Attributes Concurrency

Hi,
I use IoSession.get/setAttribute to store session specific information. I
wonder if I have to perform this operations in a 
synchronized (<some IoSession Instance>) { } block? Is locking IoSession is
right or do I have to lock some other object? 

Thanks,
alimli
-- 
View this message in context: http://www.nabble.com/IoSession-User-Defined-Attributes-Concurrency-tf4205279s16868.html#a11961876
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: IoSession User-Defined Attributes Concurrency

Posted by Trustin Lee <tr...@gmail.com>.
On 8/2/07, alimli <ha...@gmail.com> wrote:
>
> Hi,
> I use IoSession.get/setAttribute to store session specific information. I
> wonder if I have to perform this operations in a
> synchronized (<some IoSession Instance>) { } block? Is locking IoSession is
> right or do I have to lock some other object?

A lock is acquired while you access session attributes internally.
The lock object is not an IoSession instance.  If you need more
complex locking, you have to lock the accessing code block with your
lock.

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