On 3/28/07, Trustin Lee <[EMAIL PROTECTED]> wrote:
Hi Maarten,
On 3/27/07, Maarten Bosteels <[EMAIL PROTECTED]> wrote:
> Trustin,
>
> As someone pointed out in another thread there could still be a
> visibility problem, when multiple threads access the same objects,
> even when they don't do it concurrently.
>
> I am not an expert on concurrency, I just remember that visibility is
> very subtle.
> I would have to re-read the chapter on visibility in "Java
> Concurrencty in Practice"
> to be sure if there is a problem in this case. I don't think there is, though.
> I will try to have a look tonight.
I thought there was no visibility problem in CumulativeProtocolDecoder
because it had been protected by the synchronized block in
ProtocolCodecFilter. Let me check it our again. :)
It seems like I removed the synchronized block. :)
To avoid performance degradation which might be caused by using
decoder instance as a lock, I chose to create a lock object and store
it as a session attribute:
http://tinyurl.com/2ar8ky
By doing this, all decoders will be free from the visibility problem.
The change has been applied to all three branches.
Thanks,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6