Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sequentially consistent: the program behaves as if it executed sequentially for some interlacing of the instructions (across threads).

Happens-before consistent: the program behaves according to the happens-before rules of the JMM. Sequential consistency may be violated if two threads modify unsynchronized or non-volatile fields.



Thanks, I feel like I am being a bit thick here.

Would it be fair to say that happens-before consistent is a property of every java program. And sequentially consistent is a property of every java program without data-races? (ignoring unsafe/jni etc.)?


Yes, as I understand it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: