hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Rawson <ryano...@gmail.com>
Subject Re: volatile considered harmful
Date Thu, 15 Apr 2010 22:48:29 GMT
So the previous use of volatile for a boolean seems like a textbook
case, but the situation i discovered was pretty clear cut. I have no
other explanation than a highly delayed volatile read (which are
allowed).

-ryan

On Thu, Apr 15, 2010 at 3:34 PM, Todd Lipcon <todd@cloudera.com> wrote:
> On Thu, Apr 15, 2010 at 3:00 PM, Ryan Rawson <ryanobjc@gmail.com> wrote:
>
>>
>> In short, the use of volatile is not guaranteed to see an update from
>> a different thread in any timely manner. The Java Memory Model does
>> not ensure this.
>
>
> Are you sure?
> http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html#volatile seems
> to indicate it does, and I've always believed it does as well.
>
> The incrementing thing is obvious, though :)
>
> -Todd
>
> --
> Todd Lipcon
> Software Engineer, Cloudera
>

Mime
View raw message