[concurrency-interest] a volatile bug?

Aleksey Shipilev aleksey.shipilev at gmail.com
Wed May 16 13:58:48 EDT 2012


This could not happen under JMM. Are you able to reproduce it?

-Aleksey.

On Wed, May 16, 2012 at 8:55 PM, Zhong Yu <zhong.j.yu at gmail.com> wrote:
> as reported on
> http://stackoverflow.com/questions/10620680
>
> basically there are
>
>    volatile int a;
>    int b;
>
> Thread 1:
>
>    b=1;
>    a=1;
>
> Thread 2:
>
>    while(a==0)
>        ;
>    if(b==0)
>        print("error");
>
> "error" is seen printed on 32 bit JDK6 on 64bit machine
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest



More information about the Concurrency-interest mailing list