I agree with Emmanuel:  volatile might be good enough if you *only*
care about *visibility* but a synchronized block makes the intention
of the code more clear.

Are the performance benefits of volatile substantial ?
I would guess not.

Maarten

On Wed, May 14, 2008 at 5:17 PM, Emmanuel Lecharny <[EMAIL PROTECTED]> wrote:
> Sangjin Lee wrote:
>
> >  IMHO using non-volatile variables in a multi-threaded
> > situation is living dangerously.
> >
> >
>  I don't see how it can be dangerous, as far as you synchronized the code
> correctly.
>
>
>
>  --
>  --
>  cordialement, regards,
>  Emmanuel Lécharny
>  www.iktek.com
>  directory.apache.org
>
>
>

Reply via email to