[jmm-dev] Sequential Consistency

Jeremy Manson jeremymanson at google.com
Sat Feb 22 11:58:01 PST 2014


On Sat, Feb 22, 2014 at 7:59 AM, Doug Lea <dl at cs.oswego.edu> wrote:

>
> Another in the continuing series of issues to contemplate:
>
> There's a tension between those who believe that all "correct"
> programs are provably sequentially consistent versus those who
> consider sequential consistency as a goal only of lock-based programs;
> not necessarily of those using lock-free techniques and/or are
> components of distributed systems. (see for example Herlihy & Shavit's
> "The Art of Multiprocessor Programming"
> http://store.elsevier.com/The-Art-of-Multiprocessor-
> Programming/Maurice-Herlihy/isbn-9780080569581/)
>
>
Who falls into the first category?  A "correct" program is one where the
behavior matches the spec, and if that can be done with non-SC behavior
(which it often can), then the conversation is over.

I think the major limiting factor for volatiles and atomics supporting SC
(which is how I read what you are asking) is whether it can be done
reasonably (i.e., with acceptable performance) on the target platforms.  If
it can, then for everyone's sanity (and in keeping with the desire for Java
to have somewhat accessible semantics for stuff like this), it makes sense
to specify them as being SC.  If it can't, then (IMO) the IRIW-alike idioms
are few and far between enough that it makes no sense to try to decrease
everyone's performance to support SC for them.

Jeremy


More information about the jmm-dev mailing list