[concurrency-interest] a volatile bug?

Pavel Rappo pavel.rappo at gmail.com
Wed May 16 13:11:24 EDT 2012


If you see some concurrent behaviour that violates JMM then what else could that be?

On 16 May 2012, at 20:55, Zhong Yu 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